Example #1
0
        public void Equals_TwoUninitializedObjects_ResultIsTrue()
        {
            // Arrange
            var object1 = new RESTServiceConfiguration();
            var object2 = new RESTServiceConfiguration();

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsTrue(result);
        }
Example #2
0
        public void Equals_SuppliedObjectIsOfOtherType_ResultIsFalse()
        {
            // Arrange
            var object1 = new RESTServiceConfiguration {
                Hostaddress = "127.0.0.1", Hostname = "localhost", ResourcePath = "some/path"
            };
            var object2 = new object();

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsFalse(result);
        }
Example #3
0
        public void Equals_TwoIdenticalObjects_WithDifferentWhitespaces_ResultIsFalse()
        {
            // Arrange
            var object1 = new RESTServiceConfiguration {
                Hostaddress = "127.0.0.1", Hostname = "localhost", ResourcePath = "some/path"
            };
            var object2 = new RESTServiceConfiguration {
                Hostaddress = "127.0.0.1", Hostname = "localhost ", ResourcePath = "some/path "
            };

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsFalse(result);
        }
Example #4
0
        public void Equals_TwoIdenticalObject_WithDifferentNameCasing_ResultIsTrue()
        {
            // Arrange
            var object1 = new RESTServiceConfiguration {
                Hostaddress = "127.0.0.1", Hostname = "localhost", ResourcePath = "some/path"
            };
            var object2 = new RESTServiceConfiguration {
                Hostaddress = "127.0.0.1", Hostname = "LOCALHOST", ResourcePath = "SOME/PATH"
            };

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsTrue(result);
        }
Example #5
0
        public void Equals_TwoIdenticalInitializedObjects_ResultIsTrue()
        {
            // Arrange
            var object1 = new RESTServiceConfiguration {
                Hostaddress = "127.0.0.1", Hostname = "localhost", ResourcePath = "some/path"
            };
            var object2 = new RESTServiceConfiguration {
                Hostaddress = "127.0.0.1", Hostname = "localhost", ResourcePath = "some/path"
            };

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsTrue(result);
        }