public void MapEFToBOList()
        {
            var          mapper = new DALCurrencyRateMapper();
            CurrencyRate entity = new CurrencyRate();

            entity.SetProperties(1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A");

            List <BOCurrencyRate> response = mapper.MapEFToBO(new List <CurrencyRate>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
Esempio n. 2
0
        public virtual CurrencyRate MapBOToEF(
            BOCurrencyRate bo)
        {
            CurrencyRate efCurrencyRate = new CurrencyRate();

            efCurrencyRate.SetProperties(
                bo.AverageRate,
                bo.CurrencyRateDate,
                bo.CurrencyRateID,
                bo.EndOfDayRate,
                bo.FromCurrencyCode,
                bo.ModifiedDate,
                bo.ToCurrencyCode);
            return(efCurrencyRate);
        }
        public void MapEFToBO()
        {
            var          mapper = new DALCurrencyRateMapper();
            CurrencyRate entity = new CurrencyRate();

            entity.SetProperties(1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A");

            BOCurrencyRate response = mapper.MapEFToBO(entity);

            response.AverageRate.Should().Be(1m);
            response.CurrencyRateDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.CurrencyRateID.Should().Be(1);
            response.EndOfDayRate.Should().Be(1m);
            response.FromCurrencyCode.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ToCurrencyCode.Should().Be("A");
        }