Пример #1
0
        public void Init()
        {
            serviceClient = new UserService4Client();

            // create test users that can be used with the create and update methods
            User_in.Alias                       = alias;
            User_in.Password                    = "******";
            User_in.Name                        = "Klaus Klaussen";
            User_in.EMail                       = "*****@*****.**";
            User_in.DeleteConfirmation          = false;
            User_in.DeleteConfirmationSpecified = true;

            User_update.DeleteConfirmation          = true;
            User_update.DeleteConfirmationSpecified = true;

            TAddressNamed bill = new TAddressNamed();

            bill.Alias             = "bill";
            bill.FirstName         = "Klaus";
            bill.LastName          = "Klaussen2";
            bill.Street            = "Musterstraße 2";
            bill.CodePorte         = "xyz";
            bill.EMail             = "*****@*****.**";
            bill.Birthday          = new DateTime(1976, 9, 25, 11, 33, 0);
            User_in.BillingAddress = bill;

            TAddressNamed ship = new TAddressNamed();

            ship.Alias              = "ship";
            ship.FirstName          = "Klaus";
            ship.LastName           = "Klaussen3";
            ship.Street             = "Musterstraße 3";
            ship.EMail              = "*****@*****.**";
            ship.Birthday           = new DateTime(1976, 9, 25, 11, 33, 0);
            User_in.ShippingAddress = ship;

            TAddressNamed ship1 = new TAddressNamed();

            ship1.Alias     = "ship1";
            ship1.FirstName = "Klaus";
            ship1.LastName  = "Klaussen4";
            ship1.Street    = "Musterstraße 4";
            ship1.EMail     = "*****@*****.**";
            ship1.Birthday  = new DateTime(1976, 9, 25, 11, 33, 0);

            TAddressNamed ship2 = new TAddressNamed();

            //--- test without Alias
            ship2.FirstName = "Klaus";
            ship2.LastName  = "Klaussen5";
            ship2.Street    = "Musterstraße 5";
            ship2.EMail     = "*****@*****.**";
            ship2.Birthday  = new DateTime(1976, 9, 25, 11, 33, 0);

            TAddressNamed[] addresses = new TAddressNamed[] {
                ship1,
                ship2,
            };
            User_in.AdditionalAddresses = addresses;

            TAttribute attr = new TAttribute();

            attr.Name          = "ChallengePhrase";
            attr.Value         = "my challenge phrase";
            User_in.Attributes = new TAttribute[] { attr };

            User_update.Path     = path + alias;
            User_update.Password = "******";
            User_update.Name     = "Hans Hanssen";
            User_update.EMail    = "*****@*****.**";

            // IMPORTANT!!!
            // .NET has the terrible behavior, to set all boolean and numeric value that are not
            // defined to "false" resp. "0"
            // So if you update an object and do not set the "IsVisible" flag, it will set the object to
            // invisible!!!
            User_update.DeleteConfirmation = true;

            TAddressNamed bill_update = new TAddressNamed();

            bill_update.FirstName      = "Hans";
            bill_update.LastName       = "Hanssen";
            bill_update.Street         = "Musterstraße 2b";
            bill_update.CodePorte      = "uvwxyz";
            bill_update.Birthday       = new DateTime(1976, 9, 25, 11, 33, 0);
            User_update.BillingAddress = bill_update;

            TAddressNamed ship1_update = new TAddressNamed();

            ship1_update.Alias     = "ship1";
            ship1_update.FirstName = "Klaus";
            ship1_update.LastName  = "Klaussen44";
            ship1_update.Street    = "Musterstraße 44";
            ship1_update.EMail     = "*****@*****.**";
            ship1_update.Birthday  = new DateTime(1976, 9, 25, 11, 33, 0);

            TAddressNamed ship3_update = new TAddressNamed();

            ship3_update.Alias     = "ship3";
            ship3_update.FirstName = "Klaus";
            ship3_update.LastName  = "Klaussen33";
            ship3_update.Street    = "Musterstraße 33";
            ship3_update.EMail     = "*****@*****.**";
            ship3_update.Birthday  = new DateTime(1976, 9, 25, 11, 33, 0);

            TAddressNamed[] addresses_update = new TAddressNamed[] {
                ship1_update,
                ship3_update,
            };
            User_update.AdditionalAddresses = addresses_update;

            TAttribute attr_update = new TAttribute();

            attr_update.Name       = "ChallengePhrase";
            attr_update.Value      = "my updated challenge phrase";
            User_update.Attributes = new TAttribute[] { attr_update };
        }
Пример #2
0
		public void Init()
		{
			serviceClient = new UserService4Client();

			// create test users that can be used with the create and update methods
			User_in.Alias = alias;
			User_in.Password = "******";
			User_in.Name = "Klaus Klaussen";
			User_in.EMail = "*****@*****.**";
            User_in.DeleteConfirmation = false;
            User_in.DeleteConfirmationSpecified = true;

			User_update.DeleteConfirmation = true;
            User_update.DeleteConfirmationSpecified = true;

			TAddressNamed bill = new TAddressNamed();
			bill.Alias = "bill";
			bill.FirstName = "Klaus";
			bill.LastName = "Klaussen2";
			bill.Street = "Musterstraße 2";
            bill.CodePorte = "xyz";
            bill.EMail = "*****@*****.**";
			bill.Birthday = new DateTime(1976,9,25,11,33,0);
			User_in.BillingAddress = bill;

			TAddressNamed ship = new TAddressNamed();
			ship.Alias = "ship";
			ship.FirstName = "Klaus";
			ship.LastName = "Klaussen3";
			ship.Street = "Musterstraße 3";
			ship.EMail = "*****@*****.**";
			ship.Birthday = new DateTime(1976,9,25,11,33,0);
			User_in.ShippingAddress = ship;

			TAddressNamed ship1 = new TAddressNamed();
			ship1.Alias = "ship1";
			ship1.FirstName = "Klaus";
			ship1.LastName = "Klaussen4";
			ship1.Street = "Musterstraße 4";
			ship1.EMail = "*****@*****.**";
			ship1.Birthday = new DateTime(1976,9,25,11,33,0);

			TAddressNamed ship2 = new TAddressNamed();
			//--- test without Alias
			ship2.FirstName = "Klaus";
			ship2.LastName = "Klaussen5";
			ship2.Street = "Musterstraße 5";
			ship2.EMail = "*****@*****.**";
			ship2.Birthday = new DateTime(1976,9,25,11,33,0);

			TAddressNamed[] addresses = new TAddressNamed[]{
				ship1,
				ship2,
			};
			User_in.AdditionalAddresses = addresses;

			TAttribute attr = new TAttribute();
			attr.Name = "ChallengePhrase";
			attr.Value = "my challenge phrase";
			User_in.Attributes = new TAttribute[]{attr};

			User_update.Path = path + alias;
			User_update.Password = "******";
			User_update.Name = "Hans Hanssen";
			User_update.EMail = "*****@*****.**";

			// IMPORTANT!!!
			// .NET has the terrible behavior, to set all boolean and numeric value that are not
			// defined to "false" resp. "0"
			// So if you update an object and do not set the "IsVisible" flag, it will set the object to
			// invisible!!!
			User_update.DeleteConfirmation = true;

			TAddressNamed bill_update = new TAddressNamed();
			bill_update.FirstName = "Hans";
			bill_update.LastName = "Hanssen";
			bill_update.Street = "Musterstraße 2b";
            bill_update.CodePorte = "uvwxyz";
            bill_update.Birthday = new DateTime(1976, 9, 25, 11, 33, 0);
			User_update.BillingAddress = bill_update;

			TAddressNamed ship1_update = new TAddressNamed();
			ship1_update.Alias = "ship1";
			ship1_update.FirstName = "Klaus";
			ship1_update.LastName = "Klaussen44";
			ship1_update.Street = "Musterstraße 44";
			ship1_update.EMail = "*****@*****.**";
			ship1_update.Birthday = new DateTime(1976,9,25,11,33,0);

			TAddressNamed ship3_update = new TAddressNamed();
			ship3_update.Alias = "ship3";
			ship3_update.FirstName = "Klaus";
			ship3_update.LastName = "Klaussen33";
			ship3_update.Street = "Musterstraße 33";
			ship3_update.EMail = "*****@*****.**";
			ship3_update.Birthday = new DateTime(1976,9,25,11,33,0);

			TAddressNamed[] addresses_update = new TAddressNamed[]{
				ship1_update,
				ship3_update,
			};
			User_update.AdditionalAddresses = addresses_update;

			TAttribute attr_update = new TAttribute();
			attr_update.Name = "ChallengePhrase";
			attr_update.Value = "my updated challenge phrase";
			User_update.Attributes = new TAttribute[]{attr_update};
		}