public void SingleObjectUnkownLevelBoycott ( ) { var country = new Country { Name = "Serbia", Iso2 = "RS", IsoAlpha3 = "SRB", IsoUnM49Numerical = 688 }; var address = new Address { City = "Belgrade", Street = "Bulevar Kralja Aleksandra, 15", Country = country }; var consignee = new Consignee { Name = "Dimitrovgrad", Address = address }; var res = consignee.Boycott(x => x.Address.Country.Name); Assert.Catch<RuntimeBinderException>( ( ) => { Console.Write(res.Address.Country.Name); }); }
public void SingleObjectSecondLevelBoycott ( ) { var country = new Country { Name = "Serbia", Iso2 = "RS", IsoAlpha3 = "SRB", IsoUnM49Numerical = 688 }; var address = new Address { City = "Belgrade", Street = "Bulevar Kralja Aleksandra, 15", Country = country }; var res = address.Boycott(x => x.Country.Name); Assert.Throws<RuntimeBinderException>( ( ) => { Console.Write(res.Country.Name); }); }
public void SingleObjectFirstLevelBoycott ( ) { var country = new Country { Name = "Serbia", Iso2 = "RS", IsoAlpha3 = "SRB", IsoUnM49Numerical = 688 }; var res = country.Boycott(x => x.Name); Assert.Catch<RuntimeBinderException>( ( ) => { Console.Write(res.Name); }); }
public void SingleObjectUnkownLevelSanction ( ) { var country = new Country { Name = "Serbia", Iso2 = "RS", IsoAlpha3 = "SRB", IsoUnM49Numerical = 688 }; var address = new Address { City = "Belgrade", Street = "Bulevar Kralja Aleksandra, 15", Country = country }; var consignee = new Consignee { Name = "Dimitrovgrad", Address = address }; var res = consignee.Sanction(x => x.Address.Country.Name); Assert.That(res.Address.Country.Name == consignee.Address.Country.Name); }
public void SingleObjectSecondLevelSanction ( ) { var country = new Country { Name = "Serbia", Iso2 = "RS", IsoAlpha3 = "SRB", IsoUnM49Numerical = 688 }; var address = new Address { City = "Belgrade", Street = "Bulevar Kralja Aleksandra, 15", Country = country }; var res = address.Sanction(x => x.Country.Name, x=>x.Country.Iso2); Assert.That(res.Country.Name == address.Country.Name); }
public void SingleObjectFirstLevelSanction ( ) { var country = new Country { Name = "Serbia", Iso2 = "RS", IsoAlpha3 = "SRB", IsoUnM49Numerical = 688 }; var res = country.Sanction(x => x.Name, x=>x.Iso2); Assert.That(res.Name == country.Name); }