Ejemplo n.º 1
0
        public void Map_ShouldMapThePriceCorrectyWithMultiplyByWeightAndCalibration()
        {
            //Arrange
            var mapper = new Mapper <INV_DIAMONDS_INVENTORY>(Igal.ConversionDictionary);

            mapper.SetPricePolicy(PricePolicy.MultiplyByWeightAndCalibrate);
            mapper.OurPriceCalibration((decimal)1.17);

            var igalDiamond = new Igal()
            {
                Clarity         = "SI2",
                Culet           = "",
                Color           = "H",
                Cut             = "VG",
                DepthPresentage = (decimal)4.25,
                InventoryCode   = "12345",
                Fluorescence    = "MB",
                Girdle          = "",
                Length          = (decimal)3.5,
                Polish          = "G",
                Price           = 9999,
                Report          = "EGL IL",
                ReportURL       = "",
                Shape           = "BR",
                Symmetry        = "EX",
                Table           = (decimal)54.5,
                Weight          = (decimal)2.41,
                Width           = (decimal)6.35
            };
            //Act
            var inv_entry = mapper.Map(igalDiamond);

            //Assert
            inv_entry.totalprice.Should().Be((decimal)28194.1803);
        }
Ejemplo n.º 2
0
        public void Map_ShouldMapReportNumber()
        {
            //Arrange
            var mapper      = new Mapper <INV_DIAMONDS_INVENTORY>(Igal.ConversionDictionary);
            var igalDiamond = new Igal()
            {
                Clarity         = "SI2",
                Culet           = "",
                Color           = "H",
                Cut             = "VG",
                DepthPresentage = (decimal)4.25,
                InventoryCode   = "12345",
                Fluorescence    = "MB",
                Girdle          = "",
                Length          = (decimal)3.5,
                Polish          = "G",
                Price           = 9999,
                Report          = "EGL IL",
                ReportURL       = "",
                Shape           = "BR",
                Symmetry        = "EX",
                Table           = (decimal)54.5,
                Weight          = (decimal)2.41,
                Width           = (decimal)6.35,
                ReportNumber    = "123"
            };
            //Act
            var inv_entry = mapper.Map(igalDiamond);

            //Assert
            inv_entry.report_number.Should().Be("123");
        }
Ejemplo n.º 3
0
        public void Map_ShouldMapDefaultCorrecty()
        {
            //Arrange
            var mapper      = new Mapper <INV_DIAMONDS_INVENTORY>(Igal.ConversionDictionary);
            var igalDiamond = new Igal()
            {
                Clarity         = "mSI2",
                Culet           = "",
                Color           = "mH",
                Cut             = "mVG",
                DepthPresentage = (decimal)4.25,
                InventoryCode   = "12345",
                Fluorescence    = "mMB",
                Girdle          = "",
                Length          = (decimal)3.5,
                Polish          = "mG",
                Price           = 9999,
                Report          = "mEGL IL",
                ReportURL       = "",
                Shape           = "mBR",
                Symmetry        = "mEX",
                Table           = (decimal)54.5,
                Weight          = (decimal)2.41,
                Width           = (decimal)6.35
            };
            //Act
            var inv_entry = mapper.Map(igalDiamond);

            //Assert
            inv_entry.clarity.Should().Be(1);
            inv_entry.color.Should().Be(1);
            inv_entry.cut.Should().Be(1);
            inv_entry.fluorescence.Should().Be(1);
            inv_entry.polish.Should().Be(1);
            inv_entry.report.Should().Be(1);
            inv_entry.shape.Should().Be(1);
            inv_entry.symmetrical.Should().Be(1);
        }