Beispiel #1
0
        public void InvalidApplicationInfoTests(InvalidTestCases testcase)
        {
            var hrbcAppHandler = new ApplicationManager();
            var request        = new Dictionary <string, string>();

            InvalidMapperValues[testcase](request);

            var response = hrbcAppHandler.ReadHrbcApplicationInfo <HrbcApplicationInfoResponse>(request);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest));
        }
Beispiel #2
0
        public void ReadHrbcCoreTmpCompanyInfoInvalidTest(Fields field, InvalidTestCases inputType)
        {
            var fieldName          = Char.ToLowerInvariant(field.ToString()[0]) + field.ToString().Substring(1);
            var companyInfoHandler = new HrbcCoreManager();

            var request = new Dictionary <string, string>()
            {
                ["companyId"] = CompanyId,
                ["fullMode"]  = "true",
            };

            InvalidMapperValues[inputType](fieldName, CompanyName, request);

            var response = (inputType == InvalidTestCases.Missing && field == Fields.CompanyId) ? companyInfoHandler.SendHrbcCoreTmpCompanyInfoWithMissingCompanyId <HrbcCoreTmpCompanyInfoResponse>(_testConnection, request, System.Net.Http.HttpMethod.Get) :
                           companyInfoHandler.SendHrbcCoreTmpCompanyInfo <HrbcCoreTmpCompanyInfoResponse>(_testConnection, request, System.Net.Http.HttpMethod.Get);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest));
        }
        public void ReadHrbcCoreSessionInvalidTest(Fields field, InvalidTestCases inputType)
        {
            var creds              = AuthenticationInfoProvider.GetAuthSpecForCurrentTest();
            var adminUserId        = creds.Companies.First().Value.Users.First().Metadata["userId"].ToString();
            var fieldName          = Char.ToLowerInvariant(field.ToString()[0]) + field.ToString().Substring(1);
            var readSessionHandler = new HrbcCoreManager();

            var request = new Dictionary <string, string>()
            {
                ["companyId"] = CompanyId,
                ["userId"]    = adminUserId,
                ["sessionId"] = readSessionHandler.GetDefaultSessionId(_testConnection),
            };

            InvalidMapperValues[inputType](fieldName, CompanyName, request);
            creds.Dispose();

            var response = readSessionHandler.SendHrbcCoreSession <HrbcCoreSessionResponse>(_testConnection, request, System.Net.Http.HttpMethod.Get);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(HttpStatusCode.BadRequest));
        }