public void Invokes_Repository_Update_Method() { var theProject = new Project() { WorkingDirectory = "fdsa" }; ProjectRepository.Arrange(pr => pr.GetById(Arg.AnyString)).Returns(theProject); Target.LoadProject("asdf"); Target.SaveProject(); ProjectRepository.Assert(pr => pr.Save(theProject), Occurs.Once()); }
public void Populates_Project_With_Values_Retrieved_From_Repository() { const string workingDirectory = "asdf"; var projectFromRepository = new Project() { WorkingDirectory = workingDirectory }; ProjectRepository.Arrange(p => p.GetById(Arg.AnyString)).Returns(projectFromRepository); Target.LoadProject("whatever"); Assert.AreEqual <string>(projectFromRepository.WorkingDirectory, Target.ProjectViewModel.WorkingDirectory); }