public void Map_Null_Tests() { ENodeb eNodeb = null; var eNodebView = eNodeb.MapTo <ENodebView>(); eNodebView.ShouldBeNull(); }
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>()); } }
public void Map_Name_Test() { var eNodeb = new ENodeb { Name = "abcde" }; var eNodebView = eNodeb.MapTo <ENodebView>(); eNodebView.ShouldNotBeNull(); eNodebView.Name.ShouldBe("abcde"); }
public void Map_ENodebId_Test() { var eNodeb = new ENodeb { ENodebId = 22 }; var eNodebView = eNodeb.MapTo <ENodebView>(); eNodebView.ShouldNotBeNull(); eNodebView.ENodebId.ShouldBe(22); }
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); }
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"); }
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); }
public void Map_Name_Test() { var eNodeb = new ENodeb { Name = "abcde" }; var eNodebView = eNodeb.MapTo<ENodebView>(); eNodebView.ShouldNotBeNull(); eNodebView.Name.ShouldBe("abcde"); }
public void Map_ENodebId_Test() { var eNodeb = new ENodeb { ENodebId = 22 }; var eNodebView = eNodeb.MapTo<ENodebView>(); eNodebView.ShouldNotBeNull(); eNodebView.ENodebId.ShouldBe(22); }
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"); }