コード例 #1
0
        public void DadasUnaEspecificacion_CrearUnNot()
        {
            var nombreNoEstaVacioSpec = new NombreNoEstaVacioSpec();

            var andSpecification = nombreNoEstaVacioSpec.Not();
            var fakeEntity = new FakeEntity();
            Assert.IsFalse(andSpecification.IsSatisfiedBy(fakeEntity));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public void DoIfSatisfiedNoCallActionTest()
 {
     fakeEntity = new FakeEntity();
     var specificationApplicator = new SpecificationApplicator(specificationFactory.Object);
     FluentAssert.Test.Given(specificationApplicator)
         .When(CuandoSeRealizaLaAccion)
         .Should(() => Assert.False(acctionCalled))
         .Verify();
 }
コード例 #4
0
        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>());
        }