public void Get_with_existent_id_must_return_diff() { //Arrange var repository = A.Fake <IRepository>(); var differentiationService = new DifferentiationService(repository); var diff = new Differentiation(1, "dGVjZSAy", "dGVzdCAy"); A.CallTo(() => repository.GetById <Differentiation>(1)).Returns(diff); //Act var result = differentiationService.Get(1); //Assert Assert.NotNull(result); }
public void Update_with_valid_differentiation_must_succeed(int id, string left, string right) { //Arrange var repository = A.Fake <IRepository>(); var differentiationService = new DifferentiationService(repository); var diff = new Differentiation(id, left, right); A.CallTo(() => repository.GetById <Differentiation>(id)).Returns(diff); //Act var result = differentiationService.CreateOrUpdate(diff); //Assert Assert.NotNull(result); }