public void Test_ENodebWithTownIdContainer() { var excelContainer = new ENodebExcelWithTownIdContainer { TownId = 33, ENodebExcel = new ENodebExcel { Address = "abc", Name = "def", Factory = "zte" } }; var container = excelContainer.MapTo <ENodebWithTownIdContainer>(); container.TownId.ShouldBe(33); container.ENodeb.Address.ShouldBe("abc"); container.ENodeb.Name.ShouldBe("def"); container.ENodeb.Factory.ShouldBe("zte"); }
public void Test_OneItem(string name, string address, int townId, int eNodebId, string gatewayAddress, string ipAddress) { var container = new ENodebExcelWithTownIdContainer { ENodebExcel = new ENodebExcel { Name = name, Address = address, ENodebId = eNodebId, Ip = new IpAddress(ipAddress), Gateway = new IpAddress(gatewayAddress) }, TownId = townId }; var item = Mapper.Map <ENodebExcelWithTownIdContainer, ENodebWithTownIdContainer>(container); item.ENodeb.ENodebId.ShouldBe(eNodebId); item.ENodeb.Name.ShouldBe(name); item.ENodeb.Address.ShouldBe(address); item.TownId.ShouldBe(townId); item.ENodeb.Ip.AddressString.ShouldBe(ipAddress); item.ENodeb.GatewayIp.AddressString.ShouldBe(gatewayAddress); }
public void Test_OneItem(string name, string address, int townId, int eNodebId, string gatewayAddress, string ipAddress) { var container = new ENodebExcelWithTownIdContainer { ENodebExcel = new ENodebExcel { Name = name, Address = address, ENodebId = eNodebId, Ip = new IpAddress(ipAddress), GatewayIp = new IpAddress(gatewayAddress) }, TownId = townId }; var item = Mapper.Map<ENodebExcelWithTownIdContainer, ENodebWithTownIdContainer>(container); item.ENodeb.ENodebId.ShouldBe(eNodebId); item.ENodeb.Name.ShouldBe(name); item.ENodeb.Address.ShouldBe(address); item.TownId.ShouldBe(townId); item.ENodeb.Ip.AddressString.ShouldBe(ipAddress); item.ENodeb.GatewayIp.AddressString.ShouldBe(gatewayAddress); }
public void Test_ENodebWithTownIdContainer() { var excelContainer = new ENodebExcelWithTownIdContainer { TownId = 33, ENodebExcel = new ENodebExcel { Address = "abc", Name = "def", Factory = "zte" } }; var container = excelContainer.MapTo<ENodebWithTownIdContainer>(); container.TownId.ShouldBe(33); container.ENodeb.Address.ShouldBe("abc"); container.ENodeb.Name.ShouldBe("def"); container.ENodeb.Factory.ShouldBe("zte"); }