Ejemplo n.º 1
0
            public void NullCandidate_NoException(bool isValidable)
            {
                var specification = isValidable ? MockValidationSpecification.True() : MockSpecification.True();
                var sut           = new SpecificationAdapter <object>(specification);

                var exception = Record.Exception(() => sut.IsSatisfiedBy(null, out _));

                Assert.Null(exception);
            }
Ejemplo n.º 2
0
            public void TrueSpecification_ReturnTrue()
            {
                var specification = MockSpecification.True();
                var sut           = new SpecificationAdapter <object>(specification);

                var result = sut.IsSatisfiedBy(new object());

                Assert.True(result);
            }
Ejemplo n.º 3
0
            public void NullCandidate_NoException()
            {
                var specification = MockSpecification.True();
                var sut           = new SpecificationAdapter <object>(specification);

                var exception = Record.Exception(() => sut.IsSatisfiedBy(null));

                Assert.Null(exception);
            }
Ejemplo n.º 4
0
            public void TrueSpecification_ReturnExpectedResultObject(bool isValidable, SpecificationResult expected)
            {
                var specification = isValidable ? MockValidationSpecification.True() : MockSpecification.True();
                var sut           = new SpecificationAdapter <object>(specification);

                var overall = sut.IsSatisfiedBy(new object(), out var result);

                Assert.True(overall);
                Assert.Equal(expected, result, new SpecificationResultComparer());
            }
Ejemplo n.º 5
0
            public void RelatedTypes_NoException()
            {
                var specification = MockSpecification <IEnumerable <char> > .True();

                var exception = Record.Exception(() =>
                {
                    var sut = new SpecificationAdapter <ChildFakeType>(specification);
                    sut.IsSatisfiedBy(new ChildFakeType());
                });

                Assert.Null(exception);
            }