public void SutDoesNotEqualNullObject()
 {
     // Fixture setup
     var sut = new RegularExpressionRequest("[0-9]");
     object other = null;
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result);
 }
 public void SutDoesNotEqualAnonymousObject()
 {
     // Fixture setup
     var sut = new RegularExpressionRequest("[0-9]");
     object anonymousObject = new FileStyleUriParser();
     // Exercise system
     var result = sut.Equals(anonymousObject);
     // Verify outcome
     Assert.False(result);
     // Teardown
 }
        public void SutDoesNotEqualAnonymousObject()
        {
            // Arrange
            var    sut             = new RegularExpressionRequest("[0-9]");
            object anonymousObject = new ConcreteType();
            // Act
            var result = sut.Equals(anonymousObject);

            // Assert
            Assert.False(result);
        }
        public void SutDoesNotEqualOtherSutWhenPatternsAreDifferent()
        {
            // Arrange
            var sut   = new RegularExpressionRequest("[0-9]");
            var other = new RegularExpressionRequest("[A-Z]");
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
        public void SutEqualsOtherSutWhenPatternsMatch()
        {
            // Arrange
            var sut   = new RegularExpressionRequest("[0-9]");
            var other = new RegularExpressionRequest("[0-9]");
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.True(result, "Equals");
        }
        public void SutDoesNotEqualNullSut()
        {
            // Arrange
            var sut = new RegularExpressionRequest("[0-9]");
            RegularExpressionRequest other = null;
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result);
        }
Ejemplo n.º 7
0
        public void SutDoesNotEqualNullObject()
        {
            // Fixture setup
            var    sut   = new RegularExpressionRequest("[0-9]");
            object other = null;
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result);
        }
Ejemplo n.º 8
0
        public void SutDoesNotEqualOtherObjectWhenPatternsAreDifferent()
        {
            // Fixture setup
            var    sut   = new RegularExpressionRequest("[0-9]");
            object other = new RegularExpressionRequest("[A-Z]");
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Ejemplo n.º 9
0
        public void SutDoesNotEqualAnonymousObject()
        {
            // Fixture setup
            var    sut             = new RegularExpressionRequest("[0-9]");
            object anonymousObject = new ConcreteType();
            // Exercise system
            var result = sut.Equals(anonymousObject);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Ejemplo n.º 10
0
        public void SutEqualsOtherSutWhenPatternsMatch()
        {
            // Fixture setup
            var sut   = new RegularExpressionRequest("[0-9]");
            var other = new RegularExpressionRequest("[0-9]");
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.True(result, "Equals");
            // Teardown
        }
        public void CreateWithRegularExpressionAttributeRequestReturnsCorrectResult(string pattern)
        {
            // Arrange
            var regularExpressionAttribute = new RegularExpressionAttribute(pattern);
            var providedAttribute          = new ProvidedAttribute(regularExpressionAttribute, true);
            var request         = new FakeMemberInfo(providedAttribute);
            var expectedRequest = new RegularExpressionRequest(regularExpressionAttribute.Pattern);
            var expectedResult  = new object();
            var context         = new DelegatingSpecimenContext
            {
                OnResolve = r => expectedRequest.Equals(r) ? expectedResult : new NoSpecimen()
            };
            var sut = new RegularExpressionAttributeRelay();
            // Act
            var result = sut.Create(request, context);

            // Assert
            Assert.Equal(expectedResult, result);
        }
Ejemplo n.º 12
0
        public void CreateWithRegularExpressionAttributeRequestReturnsCorrectResult(string pattern)
        {
            // Fixture setup
            var regularExpressionAttribute = new RegularExpressionAttribute(pattern);
            var providedAttribute          = new ProvidedAttribute(regularExpressionAttribute, true);
            var request         = new FakeMemberInfo(providedAttribute);
            var expectedRequest = new RegularExpressionRequest(regularExpressionAttribute.Pattern);
            var expectedResult  = new object();
            var context         = new DelegatingSpecimenContext
            {
                OnResolve = r => expectedRequest.Equals(r) ? expectedResult : new NoSpecimen()
            };
            var sut = new RegularExpressionAttributeRelay();
            // Exercise system
            var result = sut.Create(request, context);

            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }
        public void CreateWithRegularExpressionAttributeRequestReturnsCorrectResult(string pattern)
        {
            // Fixture setup
            var regularExpressionAttribute = new RegularExpressionAttribute(pattern);
            var providedAttribute = new ProvidedAttribute(regularExpressionAttribute, true);
            ICustomAttributeProvider request = new FakeCustomAttributeProvider(providedAttribute);
            var expectedRequest = new RegularExpressionRequest(regularExpressionAttribute.Pattern);
            var expectedResult = new object();
            var context = new DelegatingSpecimenContext
            {
#pragma warning disable 618
                OnResolve = r => expectedRequest.Equals(r) ? expectedResult : new NoSpecimen(r)
#pragma warning restore 618
            };
            var sut = new RegularExpressionAttributeRelay();
            // Exercise system
            var result = sut.Create(request, context);
            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }
 public void SutDoesNotEqualOtherSutWhenPatternsAreDifferent()
 {
     // Fixture setup
     var sut = new RegularExpressionRequest("[0-9]");
     var other = new RegularExpressionRequest("[A-Z]");
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result, "Equals");
     // Teardown
 }
 public void SutEqualsOtherSutWhenPatternsMatch()
 {
     // Fixture setup
     var sut = new RegularExpressionRequest("[0-9]");
     var other = new RegularExpressionRequest("[0-9]");
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.True(result, "Equals");
     // Teardown
 }