Exemplo n.º 1
0
 public void SutDoesNotEqualNullSut()
 {
     // Fixture setup
     var sut = new SeededRequest(typeof(TimeSpan), new object());
     SeededRequest other = null;
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result, "Equals");
     // Teardown
 }
Exemplo n.º 2
0
        public void SutDoesNotEqualNullObject()
        {
            // Arrange
            var    sut   = new SeededRequest(typeof(DateTime), new DateTime(103029));
            object other = null;
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 3
0
        public void SutDoesNotEqualAnonymousObject()
        {
            // Arrange
            var    sut             = new SeededRequest(new object(), "Anonymous value");
            object anonymousObject = new ConcreteType();
            // Act
            var result = sut.Equals(anonymousObject);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 4
0
        public void SutDoesNotEqualNullSut()
        {
            // Arrange
            var           sut   = new SeededRequest(typeof(TimeSpan), new object());
            SeededRequest other = null;
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 5
0
 public void SutDoesNotEqualNullObject()
 {
     // Fixture setup
     var sut = new SeededRequest(typeof(DateTime), new DateTime(103029));
     object other = null;
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
Exemplo n.º 6
0
        public void SutDoesNotEqualOtherSutWhenSutSeedIsNull()
        {
            // Arrange
            var anonymousRequest = typeof(float);
            var sut   = new SeededRequest(anonymousRequest, null);
            var other = new SeededRequest(anonymousRequest, 2.9f);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 7
0
        public void SutDoesNotEqualOtherSutWhenOtherSeedIsNull()
        {
            // Arrange
            var anonymousRequest = typeof(Buffer);
            var sut   = new SeededRequest(anonymousRequest, new ConcreteType());
            var other = new SeededRequest(anonymousRequest, null);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 8
0
        public void SutEqualsOtherSutWhenRequestsAreEqualAndSeedsAreNull()
        {
            // Arrange
            var request = typeof(WeakReference);
            var sut     = new SeededRequest(request, null);
            var other   = new SeededRequest(request, null);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.True(result, "Equals");
        }
Exemplo n.º 9
0
        public void SutDoesNotEqualOtherObjectWhenRequestsDiffer()
        {
            // Arrange
            var    anonymousValue = 1;
            var    sut            = new SeededRequest(new object(), anonymousValue);
            object other          = new SeededRequest(typeof(TimeSpan), anonymousValue);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 10
0
        public void SutDoesNotEqualNullObject()
        {
            // Fixture setup
            var    sut   = new SeededRequest(typeof(DateTime), new DateTime(103029));
            object other = null;
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Exemplo n.º 11
0
        public void SutDoesNotEqualNullSut()
        {
            // Fixture setup
            var           sut   = new SeededRequest(typeof(TimeSpan), new object());
            SeededRequest other = null;
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.IsFalse(result, "Equals");
            // Teardown
        }
Exemplo n.º 12
0
        public void SutDoesNotEqualAnonymousObject()
        {
            // Fixture setup
            var    sut             = new SeededRequest(new object(), "Anonymous value");
            object anonymousObject = new FileStyleUriParser();
            // Exercise system
            var result = sut.Equals(anonymousObject);

            // Verify outcome
            Assert.IsFalse(result, "Equals");
            // Teardown
        }
Exemplo n.º 13
0
        public void SutDoesNotEqualOtherSutWhenSeedsDiffer()
        {
            // Arrange
            var anonymousRequest = 1;
            var sut   = new SeededRequest(anonymousRequest, 98);
            var other = new SeededRequest(anonymousRequest, "Anonymous value");
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 14
0
        public void SutDoesNotEqualOtherObjectWhenSutSeedIsNull()
        {
            // Arrange
            var    anonymousRequest = string.Empty;
            var    sut   = new SeededRequest(anonymousRequest, null);
            object other = new SeededRequest(anonymousRequest, 2.9f);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.False(result, "Equals");
        }
Exemplo n.º 15
0
        public void SutDoesNotEqualOtherSutWhenSutSeedIsNull()
        {
            // Fixture setup
            var anonymousRequest = typeof(float);
            var sut   = new SeededRequest(anonymousRequest, null);
            var other = new SeededRequest(anonymousRequest, 2.9f);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result, "Equals");
            // Teardown
        }
Exemplo n.º 16
0
        public void SutEqualsOtherSutWhenRequestsAndSeedEquals()
        {
            // Arrange
            var request = typeof(object);
            var seed    = new ConcreteType();
            var sut     = new SeededRequest(request, seed);
            var other   = new SeededRequest(request, seed);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.True(result);
        }
Exemplo n.º 17
0
        public void SutDoesNotEqualOtherObjectWhenOtherSeedIsNull()
        {
            // Fixture setup
            var    anonymousRequest = typeof(Buffer);
            var    sut   = new SeededRequest(anonymousRequest, new ConcreteType());
            object other = new SeededRequest(anonymousRequest, null);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.False(result, "Equals");
            // Teardown
        }
Exemplo n.º 18
0
        public void SutDoesNotEqualOtherSutWhenOtherSeedIsNull()
        {
            // Fixture setup
            var anonymousRequest = typeof(Buffer);
            var sut   = new SeededRequest(anonymousRequest, new GopherStyleUriParser());
            var other = new SeededRequest(anonymousRequest, null);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.IsFalse(result, "Equals");
            // Teardown
        }
Exemplo n.º 19
0
        public void SutDoesNotEqualOtherSutWhenSeedsDiffer()
        {
            // Fixture setup
            var anonymousRequest = 1;
            var sut   = new SeededRequest(anonymousRequest, 98);
            var other = new SeededRequest(anonymousRequest, "Anonymous value");
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.IsFalse(result, "Equals");
            // Teardown
        }
Exemplo n.º 20
0
        public void SutDoesNotEqualOtherObjectWhenSutSeedIsNull()
        {
            // Fixture setup
            var    anonymousRequest = string.Empty;
            var    sut   = new SeededRequest(anonymousRequest, null);
            object other = new SeededRequest(anonymousRequest, 2.9f);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.IsFalse(result, "Equals");
            // Teardown
        }
Exemplo n.º 21
0
        public void SutEqualsOtherSutWhenRequestsAndSeedEquals()
        {
            // Arrange
            var request = typeof(ConcreteType);
            var seed    = new TypeWithConcreteParameterMethod();
            var sut     = new SeededRequest(request, seed);
            var other   = new SeededRequest(request, seed);
            // Act
            var result = sut.Equals(other);

            // Assert
            Assert.True(result, "Equals");
        }
Exemplo n.º 22
0
        public void SutDoesNotEqualOtherSutWhenRequestsDiffer()
        {
            // Fixture setup
            var anonymousValue = 1;
            var sut            = new SeededRequest(new object(), anonymousValue);
            var other          = new SeededRequest(typeof(TimeSpan), anonymousValue);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.IsFalse(result, "Equals");
            // Teardown
        }
Exemplo n.º 23
0
        public void SutEqualsOtherSutWhenRequestsAreEqualAndSeedsAreNull()
        {
            // Fixture setup
            var request = typeof(WeakReference);
            var sut     = new SeededRequest(request, null);
            var other   = new SeededRequest(request, null);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.IsTrue(result, "Equals");
            // Teardown
        }
Exemplo n.º 24
0
        public void SutEqualsOtherSutWhenRequestsAndSeedEquals()
        {
            // Fixture setup
            var request = typeof(HttpStyleUriParser);
            var seed    = new OperatingSystem(PlatformID.WinCE, new Version());
            var sut     = new SeededRequest(request, seed);
            var other   = new SeededRequest(request, seed);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.IsTrue(result, "Equals");
            // Teardown
        }
Exemplo n.º 25
0
        public void SutEqualsOtherSutWhenRequestsAndSeedEquals()
        {
            // Fixture setup
            var request = typeof(ConcreteType);
            var seed    = new TypeWithConcreteParameterMethod();
            var sut     = new SeededRequest(request, seed);
            var other   = new SeededRequest(request, seed);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.True(result, "Equals");
            // Teardown
        }
Exemplo n.º 26
0
        public void SutEqualsOtherSutWhenRequestsAndSeedEquals()
        {
            // Fixture setup
            var request = typeof(object);
            var seed    = new ConcreteType();
            var sut     = new SeededRequest(request, seed);
            var other   = new SeededRequest(request, seed);
            // Exercise system
            var result = sut.Equals(other);

            // Verify outcome
            Assert.True(result);
            // Teardown
        }
Exemplo n.º 27
0
        public void CreateFromFieldRequestWillCorrectlyInvokeContainer()
        {
            // Arrange
            var sut             = new FieldRequestRelay();
            var fieldInfo       = typeof(FieldHolder <object>).GetField("Field");
            var expectedRequest = new SeededRequest(fieldInfo.FieldType, fieldInfo.Name);

            var mockVerified  = false;
            var containerMock = new DelegatingSpecimenContext();

            containerMock.OnResolve = r => mockVerified = expectedRequest.Equals(r);
            // Act
            sut.Create(fieldInfo, containerMock);
            // Assert
            Assert.True(mockVerified, "Mock verification");
        }
Exemplo n.º 28
0
 public void SutDoesNotEqualOtherSutWhenOtherSeedIsNull()
 {
     // Fixture setup
     var anonymousRequest = typeof(Buffer);
     var sut = new SeededRequest(anonymousRequest, new GopherStyleUriParser());
     var other = new SeededRequest(anonymousRequest, null);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result, "Equals");
     // Teardown
 }
Exemplo n.º 29
0
 public void SutEqualsOtherSutWhenRequestsAndSeedEquals()
 {
     // Fixture setup
     var request = typeof(HttpStyleUriParser);
     var seed = new OperatingSystem(PlatformID.WinCE, new Version());
     var sut = new SeededRequest(request, seed);
     var other = new SeededRequest(request, seed);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.True(result, "Equals");
     // Teardown
 }
Exemplo n.º 30
0
 public void SutEqualsOtherSutWhenRequestsAreEqualAndSeedsAreNull()
 {
     // Fixture setup
     var request = typeof(WeakReference);
     var sut = new SeededRequest(request, null);
     var other = new SeededRequest(request, null);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.True(result, "Equals");
     // Teardown
 }
Exemplo n.º 31
0
 public void SutDoesNotEqualAnonymousObject()
 {
     // Fixture setup
     var sut = new SeededRequest(new object(), "Anonymous value");
     object anonymousObject = new FileStyleUriParser();
     // Exercise system
     var result = sut.Equals(anonymousObject);
     // Verify outcome
     Assert.False(result, "Equals");
     // Teardown
 }
Exemplo n.º 32
0
 public void SutDoesNotEqualOtherObjectWhenRequestsDiffer()
 {
     // Fixture setup
     var anonymousValue = 1;
     var sut = new SeededRequest(new object(), anonymousValue);
     object other = new SeededRequest(typeof(TimeSpan), anonymousValue);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result, "Equals");
     // Teardown
 }
Exemplo n.º 33
0
 public void SutDoesNotEqualOtherSutWhenSutSeedIsNull()
 {
     // Fixture setup
     var anonymousRequest = typeof(float);
     var sut = new SeededRequest(anonymousRequest, null);
     var other = new SeededRequest(anonymousRequest, 2.9f);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.IsFalse(result, "Equals");
     // Teardown
 }
Exemplo n.º 34
0
 public void SutDoesNotEqualOtherObjectWhenSutSeedIsNull()
 {
     // Fixture setup
     var anonymousRequest = string.Empty;
     var sut = new SeededRequest(anonymousRequest, null);
     object other = new SeededRequest(anonymousRequest, 2.9f);
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result, "Equals");
     // Teardown
 }
Exemplo n.º 35
0
 public void SutDoesNotEqualOtherSutWhenSeedsDiffer()
 {
     // Fixture setup
     var anonymousRequest = 1;
     var sut = new SeededRequest(anonymousRequest, 98);
     var other = new SeededRequest(anonymousRequest, "Anonymous value");
     // Exercise system
     var result = sut.Equals(other);
     // Verify outcome
     Assert.False(result, "Equals");
     // Teardown
 }
        public void CreateFromFieldRequestWillCorrectlyInvokeContainer()
        {
            // Fixture setup
            var sut = new FieldRequestRelay();
            var fieldInfo = typeof(FieldHolder<object>).GetField("Field");
            var expectedRequest = new SeededRequest(fieldInfo.FieldType, fieldInfo.Name);

            var mockVerified = false;
            var containerMock = new DelegatingSpecimenContext();
            containerMock.OnResolve = r => mockVerified = expectedRequest.Equals(r);
            // Exercise system
            sut.Create(fieldInfo, containerMock);
            // Verify outcome
            Assert.True(mockVerified, "Mock verification");
            // Teardown
        }