Skip to content
Discussion options

You must be logged in to vote

But if i have this kind of fetc how do i make a test for it when the resourcedal needs to be injected?

    private void Fetch(int id, [Inject] IResourceDal dal)
    {
        var data = dal.Fetch(id);
      using (BypassPropertyChecks)
      {
        Id = data.Id;
        FirstName = data.FirstName;
        LastName = data.LastName;
        TimeStamp = data.LastChanged;
        Assignments = DataPortal.FetchChild<ResourceAssignments>(id);
      }
    }

The test method something like this:

    [TestMethod]
    public void ResourceTestFetch()
    {
      IResourceDal dal = new ProjectTracker.DalMock.ResourceDal();
      var result = Csla.DataPortal.Fetch<ResourceEdit>(OriginalId, dal);
  …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@TheCakeMonster
Comment options

Comment options

You must be logged in to vote
4 replies
@TheCakeMonster
Comment options

@RocketLabsDev
Comment options

@TheCakeMonster
Comment options

@RocketLabsDev
Comment options

Answer selected by RocketLabsDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants