Beispiel #1
0
        public void DirectMappingWorksCorrectly()
        {
            DirectMapping direct = new DirectMapping("X");
            Dictionary <string, object> inputRow = new Dictionary <string, object>();

            inputRow.Add("X", "a");
            inputRow.Add("Y", "b");
            object expected = "a";
            object actual   = direct.GetValue(inputRow);

            Assert.AreEqual(expected, actual, "Direct mapping didn't extract correct value");
        }
Beispiel #2
0
        public void DirectMappingWorksCorrectlyWhenBlank()
        {
            DirectMapping direct = new DirectMapping("Z");
            Dictionary <string, object> inputRow = new Dictionary <string, object>();

            inputRow.Add("X", "a");
            inputRow.Add("Y", "b");
            object expected = "";
            object actual   = direct.GetValue(inputRow);

            Assert.AreEqual(expected, actual, "Direct mapping didn't extract null when couldn't find value");
        }
Beispiel #3
0
        public void DirectMappingWorks()
        {
            DirectMapping mapper = new DirectMapping("X");

            BaseTransformation[]        transformations = new BaseTransformation[] { };
            SingleMapping               fullMapping     = new SingleMapping(mapper, transformations);
            Dictionary <string, object> inputRow        = new Dictionary <string, object>();

            inputRow.Add("X", "a");
            object expected = "a";
            object actual   = fullMapping.GetValue(inputRow);

            Assert.AreEqual(expected, actual, "Direct transformation didn't extract correct value");
        }
Beispiel #4
0
        public void FullMappingWorks()
        {
            DirectMapping mapper = new DirectMapping("Y");

            BaseTransformation[] transformations = new BaseTransformation[] { };
            SingleMapping        singleMapping   = new SingleMapping(mapper, transformations);
            FullMapping          fullMapping     = new FullMapping();

            fullMapping.AddMapping("Z", singleMapping);
            Dictionary <string, object> inputRow = new Dictionary <string, object>();

            inputRow.Add("X", "a");
            inputRow.Add("Y", "b");
            Dictionary <string, object> expected = new Dictionary <string, object>();

            expected.Add("Z", "b");
            Dictionary <string, object> actual = fullMapping.GetRow(inputRow);

            CollectionAssert.AreEqual(expected, actual, "Full mapping didn't work as expected");
        }