Пример #1
0
        public void ValidApplicationInfoTests(ValidTestCases testcase, UserType usertype)
        {
            ApiResponse <HrbcApplicationInfoResponse.SuccessResponse> response = null;
            var connection = AuthApiConnection.GetConnectionForCurrentTest();
            var appHandler = new ApplicationManager();
            var request    = new Dictionary <string, string>()
            {
                ["myapp"] = testcase.GetHashCode().ToString()
            };

            if (UserType.User == usertype)
            {
                connection.DeAuthenticate();
                connection.Authenticate(CompanyName, NormalUserLogin, NormalUserPassword);
            }

            response = appHandler.ReadHrbcApplicationInfo <HrbcApplicationInfoResponse.SuccessResponse>(request);
            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(HttpStatusCode.OK));
            foreach (var app in response.Result.AppInfo.TakeWhile(item => item.ApplicationID == long.Parse(AppInfo.Metadata[ApplicationID].ToString())))
            {
                VerifyAppData(app, AppInfo);
            }
        }