Exemplo n.º 1
0
        public void CreateWithNullRequestThrows()
        {
            // Arrange
            var sut = new Omitter();
            // Act & assert
            var dummyContext = new DelegatingSpecimenContext();

            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Create(null, dummyContext));
        }
Exemplo n.º 2
0
        public void CreateWithNullRequestThrows()
        {
            // Fixture setup
            var sut = new Omitter();
            // Exercise system and verify outcome
            var dummyContext = new DelegatingSpecimenContext();

            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Create(null, dummyContext));
            // Teardown
        }
Exemplo n.º 3
0
        public void CreateReturnsCorrectResult()
        {
            // Arrange
            var sut = new Omitter();
            // Act
            var dummyRequest = new object();
            var dummyContext = new DelegatingSpecimenContext();
            var actual       = sut.Create(dummyRequest, dummyContext);

            // Assert
            Assert.IsAssignableFrom <OmitSpecimen>(actual);
        }
Exemplo n.º 4
0
        public void CreateReturnsCorrectResult()
        {
            // Fixture setup
            var sut = new Omitter();
            // Exercise system
            var dummyRequest = new object();
            var dummyContext = new DelegatingSpecimenContext();
            var actual       = sut.Create(dummyRequest, dummyContext);

            // Verify outcome
            Assert.IsAssignableFrom <OmitSpecimen>(actual);
            // Teardown
        }
Exemplo n.º 5
0
        public void CreateWhenSpecificationIsFalseReturnsCorrectResult()
        {
            // Arrange
            var sut     = new Omitter(new FalseRequestSpecification());
            var request = new object();
            // Act
            var dummyContext = new DelegatingSpecimenContext();
            var actual       = sut.Create(request, dummyContext);
            // Assert
            var expected = new NoSpecimen();

            Assert.Equal(expected, actual);
        }
Exemplo n.º 6
0
        public void CreateWhenSpecificationIsFalseReturnsCorrectResult()
        {
            // Fixture setup
            var sut     = new Omitter(new FalseRequestSpecification());
            var request = new object();
            // Exercise system
            var dummyContext = new DelegatingSpecimenContext();
            var actual       = sut.Create(request, dummyContext);
            // Verify outcome
            var expected = new NoSpecimen();

            Assert.Equal(expected, actual);
            // Teardown
        }
Exemplo n.º 7
0
        public void CreateWhenSpecificationMatchesRequestReturnsCorrectResult()
        {
            // Arrange
            var request       = new object();
            var specification = new DelegatingRequestSpecification
            {
                OnIsSatisfiedBy = request.Equals
            };
            var sut = new Omitter(specification);
            // Act
            var dummyContext = new DelegatingSpecimenContext();
            var actual       = sut.Create(request, dummyContext);

            // Assert
            Assert.IsAssignableFrom <OmitSpecimen>(actual);
        }
Exemplo n.º 8
0
        public void CreateWhenSpecificationMatchesRequestReturnsCorrectResult()
        {
            // Fixture setup
            var request       = new object();
            var specification = new DelegatingRequestSpecification
            {
                OnIsSatisfiedBy = request.Equals
            };
            var sut = new Omitter(specification);
            // Exercise system
            var dummyContext = new DelegatingSpecimenContext();
            var actual       = sut.Create(request, dummyContext);

            // Verify outcome
            Assert.IsAssignableFrom <OmitSpecimen>(actual);
            // Teardown
        }