示例#1
0
        public void Equals_ReturnsTrue_WhenSameAndBothKeysNull()
        {
            //Arrange
            var mapping1 = new TypeMapping()
            {
                FromAssembly = "fromAssem",
                FromType     = "fromType",
                ToAssembly   = "ToAssem",
                ToType       = "ToType",
                Key          = null
            };

            var mapping2 = new TypeMapping()
            {
                FromAssembly = "fromAssem",
                FromType     = "fromType",
                ToAssembly   = "ToAssem",
                ToType       = "ToType",
                Key          = null
            };

            //Act
            bool target = mapping1.Equals(mapping2);

            //Assert
            Assert.IsTrue(target);
        }
示例#2
0
        public void Equals_ReturnsTrue_WhenSameValueDifferentInstances()
        {
            //Arrange
            var mapping1 = new TypeMapping()
            {
                FromAssembly = "fromAssem",
                FromType     = "fromType",
                ToAssembly   = "ToAssem",
                ToType       = "ToType",
                Key          = "Key"
            };

            var mapping2 = new TypeMapping()
            {
                FromAssembly = "fromAssem",
                FromType     = "fromType",
                ToAssembly   = "ToAssem",
                ToType       = "ToType",
                Key          = "Key"
            };

            //Act
            bool target = mapping1.Equals(mapping2);

            //Assert
            Assert.IsTrue(target);
        }
示例#3
0
        public void Equals_ReturnsFalse_WhenCompareKeyNull()
        {
            //Arrange
            var mapping1 = new TypeMapping()
            {
                FromAssembly = "fromAssem",
                FromType     = "fromType",
                ToAssembly   = "ToAssem",
                ToType       = "ToType",
                Key          = "Key"
            };

            var mapping2 = new TypeMapping()
            {
                FromAssembly = "fromAssem",
                FromType     = "fromType",
                ToAssembly   = "ToAssem",
                ToType       = "ToType",
                Key          = null
            };

            //Act
            bool target = mapping1.Equals(mapping2);

            //Assert
            Assert.IsFalse(target);
        }
示例#4
0
        public void Equals_ReturnsTrueWhenSameInstance()
        {
            //Arrange
            var mapping = new TypeMapping()
            {
                FromAssembly = "fromAssem",
                FromType     = "fromType",
                ToAssembly   = "ToAssem",
                ToType       = "ToType",
                Key          = "Key"
            };

            //Act
            bool target = mapping.Equals(mapping);

            //Assert
            Assert.IsTrue(target);
        }