public void ShouldChangeStatusOfProject() { //arrange var projectShouldChange = new Project() { Id = 1, DestinationId = 1, Name = "example", ProjectStatusId = 1 }; var projectShouldNotChange = new Project() { Id = 2, DestinationId = 1, Name = "example2", ProjectStatusId = 2 }; var config = new MapperConfiguration(cfg => { cfg.AddProfile(new MappingProfile()); }); var mapper = config.CreateMapper(); var destRepo = new Mock <IDestinationRepository>(); destRepo.Setup(d => d.GetProjectById(1)).Returns(projectShouldChange); destRepo.Setup(d => d.GetProjectById(2)).Returns(projectShouldNotChange); var destServ = new DestinationService(destRepo.Object, mapper); //act destServ.CloseProject(1); destServ.CloseProject(2); //assert projectShouldChange.ProjectStatusId.Should().Be(2); projectShouldNotChange.ProjectStatusId.Should().Be(2); }