AWSSDK_DotNet.IntegrationTests.Tests.IAM.IAMUtil.MakePath C# (CSharp) Method

MakePath() public static method

public static MakePath ( ) : string
return string
        public static string MakePath(params string[] elements)
        {
            string path = TEST_PATH;
            foreach (string s in elements)
            {
                path = string.Format("{0}{1}/", path, s);
            }

            return path;
        }

Usage Example

Beispiel #1
0
        public void TestUpdateUser()
        {
            string
                username    = "******" + DateTime.Now.Ticks,
                newusername = "******" + DateTime.Now.Ticks;
            string
                firstPath  = IAMUtil.MakePath("first"),
                secondPath = IAMUtil.MakePath("second");

            try
            {
                Client.CreateUser(new CreateUserRequest()
                {
                    UserName = username, Path = firstPath
                });

                GetUserResponse response = Client.GetUser(new GetUserRequest()
                {
                    UserName = username
                });
                Assert.AreEqual(firstPath, response.User.Path);

                string id = response.User.UserId;

                Client.UpdateUser(new UpdateUserRequest()
                {
                    UserName = username, NewPath = secondPath, NewUserName = newusername
                });

                response = Client.GetUser(new GetUserRequest()
                {
                    UserName = newusername
                });

                Assert.AreEqual(newusername, response.User.UserName);
                Assert.AreEqual(secondPath, response.User.Path);
                Assert.AreEqual(id, response.User.UserId);
            }
            finally
            {
                Client.DeleteUser(new DeleteUserRequest()
                {
                    UserName = newusername
                });
            }
        }
All Usage Examples Of AWSSDK_DotNet.IntegrationTests.Tests.IAM.IAMUtil::MakePath