public void Init3(
			[Values("Республика", "Край", "Область")] string region,
			[Values("Россия","Германия", "Китай")] string country,
			[Values("846194", "941349", "9175453")] string postсode
			)
		{
			var type = new Address();
			type.region = region;
			type.country = country;
			type.postсode = postсode;

			var xml = type.Serialize();
			Assert.IsNotNullOrEmpty(xml);
			var obj = Address.Deserialize(xml);
			EqualTo(obj, type);
		}
		public void Init2(
			[Values(null, "3", "17", "56")] string flat,
			[Values("Москва", "Колобовщина", "Машкины")] string settlement,
			[Values("Центральный район", "Советский район", "Ленинский район")] string district
			)
		{
			var type = new Address();
			type.flat = flat;
			type.settlement = settlement;
			type.district = district;

			var xml = type.Serialize();
			Assert.IsNotNullOrEmpty(xml);
			var obj = Address.Deserialize(xml);
			EqualTo(obj, type);
		}
		public void Init(
			[Values("Советская", "Молодежная", "Центральная")] string street,
			[Values("2", "6c2", "12/31")] string house,
			[Values(null, "a", "6", "10")] string building
			)
		{
			var type = new Address();
			type.street = street;
			type.house = house;
			type.building = building;

			var xml = type.Serialize();
			Assert.IsNotNullOrEmpty(xml);
			var obj = Address.Deserialize(xml);
			EqualTo(obj, type);
		}
		public void Create()
		{
			var type = new Address();
			Assert.IsNullOrEmpty(type.street);
			Assert.IsNullOrEmpty(type.house);
			Assert.IsNullOrEmpty(type.building);
			Assert.IsNullOrEmpty(type.flat);
			Assert.IsNullOrEmpty(type.settlement);
			Assert.IsNullOrEmpty(type.district);
			Assert.IsNullOrEmpty(type.region);
			Assert.IsNullOrEmpty(type.country);
			Assert.IsNullOrEmpty(type.postсode);
			Assert.IsNullOrEmpty(type.postbox);
			Assert.IsNullOrEmpty(type.nontypical);
			Assert.IsNullOrEmpty(type.Value);
		}
示例#5
0
		protected static void EqualTo(Address source, Address target)
		{
			Assert.IsNotNull(source);
			Assert.IsNotNull(target);

			Assert.That(source.street, Is.EqualTo(target.street));
			Assert.That(source.house, Is.EqualTo(target.house));
			Assert.That(source.building, Is.EqualTo(target.building));
			Assert.That(source.flat, Is.EqualTo(target.flat));
			Assert.That(source.settlement, Is.EqualTo(target.settlement));
			Assert.That(source.district, Is.EqualTo(target.district));
			Assert.That(source.region, Is.EqualTo(target.region));
			Assert.That(source.country, Is.EqualTo(target.country));
			Assert.That(source.postсode, Is.EqualTo(target.postсode));
			Assert.That(source.postbox, Is.EqualTo(target.postbox));
			Assert.That(source.nontypical, Is.EqualTo(target.nontypical));
			Assert.That(source.Value, Is.EqualTo(target.Value));
		}
示例#6
0
		public static bool LoadFromFile(string fileName, out Address obj)
		{
			System.Exception exception = null;
			return LoadFromFile(fileName, out obj, out exception);
		}
示例#7
0
		public static bool LoadFromFile(string fileName, out Address obj, out System.Exception exception)
		{
			return LoadFromFile(fileName, Encoding.UTF8, out obj, out exception);
		}
示例#8
0
		/// <summary>
		/// Deserializes xml markup from file into an Address object
		/// </summary>
		/// <param name="fileName">string xml file to load and deserialize</param>
		/// <param name="obj">Output Address object</param>
		/// <param name="exception">output Exception value if deserialize failed</param>
		/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
		public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Address obj, out System.Exception exception)
		{
			exception = null;
			obj = default(Address);
			try
			{
				obj = LoadFromFile(fileName, encoding);
				return true;
			}
			catch ( System.Exception ex )
			{
				exception = ex;
				return false;
			}
		}
示例#9
0
		public static bool Deserialize(string xml, out Address obj)
		{
			System.Exception exception = null;
			return Deserialize(xml, out obj, out exception);
		}
示例#10
0
		/// <summary>
		/// Deserializes workflow markup into an Address object
		/// </summary>
		/// <param name="xml">string workflow markup to deserialize</param>
		/// <param name="obj">Output Address object</param>
		/// <param name="exception">output Exception value if deserialize failed</param>
		/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
		public static bool Deserialize(string xml, out Address obj, out System.Exception exception)
		{
			exception = null;
			obj = default(Address);
			try
			{
				obj = Deserialize(xml);
				return true;
			}
			catch ( System.Exception ex )
			{
				exception = ex;
				return false;
			}
		}
示例#11
0
		public void Init4(
			[Values(null, "а/я 5", "а/я 15")] string postbox,
			[Values(null, "прочие", "элементы")]string nontypical
			)
		{
			var type = new Address();
			type.postbox = postbox;
			type.nontypical = nontypical;

			var xml = type.Serialize();
			Assert.IsNotNullOrEmpty(xml);
			var obj = Address.Deserialize(xml);
			EqualTo(obj, type);
		}
		public OrganizationOnly()
		{
			this.econtactField = new List<Econtact>();
			this.addressField = new Address();
		}