public void DadasUnaEspecificacion_CrearUnNot() { var nombreNoEstaVacioSpec = new NombreNoEstaVacioSpec(); var andSpecification = nombreNoEstaVacioSpec.Not(); var fakeEntity = new FakeEntity(); Assert.IsFalse(andSpecification.IsSatisfiedBy(fakeEntity)); }
public void DadasDosEspecificaciones_CrearUnOr() { var nombreNoEstaVacioSpec = new NombreNoEstaVacioSpec(); var nombreNoEsNuloSpec = new NombreNoEsNuloSpec(); var andSpecification = nombreNoEstaVacioSpec.Or(nombreNoEsNuloSpec); var fakeEntity = new FakeEntity(); Assert.IsTrue(andSpecification.IsSatisfiedBy(fakeEntity)); }
public void DoIfSatisfiedNoCallActionTest() { fakeEntity = new FakeEntity(); var specificationApplicator = new SpecificationApplicator(specificationFactory.Object); FluentAssert.Test.Given(specificationApplicator) .When(CuandoSeRealizaLaAccion) .Should(() => Assert.False(acctionCalled)) .Verify(); }
public void DoIfSatisfiedSpecDeDosEntidadesCallActionTest() { fakeEntity = new FakeEntity { Name = "Probando" }; var specificationApplicator = new SpecificationApplicator(specificationFactory.Object); specificationFactory.Setup(f => f.GetSpecification<FakeSpec2, FakeEntity, FakeEntity>()).Returns( new FakeSpec2()); specificationApplicator.DoIfSatisfied<FakeSpec2, FakeEntity, FakeEntity>(fakeEntity, fakeEntity, (entity, entity1) => { }); specificationFactory.Verify(f => f.GetSpecification<FakeSpec2, FakeEntity, FakeEntity>()); }