コード例 #1
0
        public void Map_Null_Tests()
        {
            ENodeb eNodeb     = null;
            var    eNodebView = eNodeb.MapTo <ENodebView>();

            eNodebView.ShouldBeNull();
        }
コード例 #2
0
        private ENodebView GenerateENodebView(ENodeb item)
        {
            if (item == null)
            {
                return(null);
            }
            var town = _townRepository.FirstOrDefault(x => x.Id == item.TownId);

            if (town != null)
            {
                var result = town.MapTo <ENodebView>();
                return(item.MapTo(result));
            }
            else
            {
                return(item.MapTo <ENodebView>());
            }
        }
コード例 #3
0
        public void Map_Name_Test()
        {
            var eNodeb = new ENodeb {
                Name = "abcde"
            };
            var eNodebView = eNodeb.MapTo <ENodebView>();

            eNodebView.ShouldNotBeNull();
            eNodebView.Name.ShouldBe("abcde");
        }
コード例 #4
0
        public void Map_ENodebId_Test()
        {
            var eNodeb = new ENodeb {
                ENodebId = 22
            };
            var eNodebView = eNodeb.MapTo <ENodebView>();

            eNodebView.ShouldNotBeNull();
            eNodebView.ENodebId.ShouldBe(22);
        }
コード例 #5
0
        private ENodebView GenerateENodebView(ENodeb item)
        {
            if (item == null)
            {
                return(null);
            }
            var town   = _townRepository.Get(item.TownId);
            var result = item.MapTo <ENodebView>();

            town.MapTo(result);
            return(result);
        }
コード例 #6
0
        public void Test_Module_Map_ENodebView()
        {
            var eNodeb = new ENodeb
            {
                ENodebId = 1,
                Factory  = "Huawei"
            };
            var view = eNodeb.MapTo <ENodebView>();

            view.ENodebId.ShouldBe(1);
            view.Factory.ShouldBe("Huawei");
        }
コード例 #7
0
ファイル: ENodebView.cs プロジェクト: yanzj/BackGround
        public static ENodebView ConstructView(ENodeb item, ITownRepository townRepository)
        {
            var town = townRepository.FirstOrDefault(x => x.Id == item.TownId);
            var view = item.MapTo <ENodebView>();

            if (town != null)
            {
                view.CityName     = town.CityName;
                view.DistrictName = town.DistrictName;
                view.TownName     = town.TownName;
            }
            return(view);
        }
コード例 #8
0
 public void Map_Name_Test()
 {
     var eNodeb = new ENodeb { Name = "abcde" };
     var eNodebView = eNodeb.MapTo<ENodebView>();
     eNodebView.ShouldNotBeNull();
     eNodebView.Name.ShouldBe("abcde");
 }
コード例 #9
0
 public void Map_ENodebId_Test()
 {
     var eNodeb = new ENodeb { ENodebId = 22 };
     var eNodebView = eNodeb.MapTo<ENodebView>();
     eNodebView.ShouldNotBeNull();
     eNodebView.ENodebId.ShouldBe(22);
 }
コード例 #10
0
 public void Test_Module_Map_ENodebView()
 {
     var eNodeb = new ENodeb
     {
         ENodebId = 1,
         Factory = "Huawei"
     };
     var view = eNodeb.MapTo<ENodebView>();
     view.ENodebId.ShouldBe(1);
     view.Factory.ShouldBe("Huawei");
 }