public async Task Chubb_Create_ShouldReturnCreatedStatus()
        {
            var testData = _chubbHelpers.GetDefaultTestData(ChubbApplicationStatus.Open);

            var createResult = await _httpHelpers.CreateApplication(testData);

            createResult.StatusCode.Should().Be(HttpStatusCode.Created);
        }
示例#2
0
        public async Task BuildersRisk_Create_ShouldReturnCreatedStatus()
        {
            var testData = _buildersRiskHelpers.GetDefaultTestData(BuildersRiskApplicationStatus.Open);

            var createResult = await _httpHelpers.CreateApplication(testData);

            createResult.StatusCode.Should().Be(HttpStatusCode.Created);
        }
示例#3
0
        public async Task Artisans_GetQuote_ShouldReturnCorrectSchema()
        {
            var testData = _nautilusHelpers.GetDefaultTestData(ArtisansApplicationStatus.Quoted);

            var applicationResult = await _testHelpers.CreateApplication(testData);

            var applicationId = applicationResult.ApplicationId;

            await _testHelpers.CreateQuote(applicationId);

            var quoteResult = await _testHelpers.GetQuote(applicationId);

            quoteResult.StatusCode.Should().Be(HttpStatusCode.OK);

            JObject quoteObj = JObject.Parse(quoteResult.Quote);

            var schemaData   = _quoteSchema.ToJson();
            var schemaErrors = _quoteSchema.Validate(quoteObj);

            schemaErrors.Count.Should().Be(0);
        }
        public async Task Artisans_Get_ShouldReturnCorrectSchema()
        {
            var testData = _nautilusHelpers.GetDefaultTestData(ArtisansApplicationStatus.Open);

            var createResult = await _httpHelpers.CreateApplication(testData);

            var applicationId = createResult.ApplicationId;

            var applicationResult = await _httpHelpers.GetApplication(applicationId);

            applicationResult.StatusCode.Should().Be(HttpStatusCode.OK);

            JObject appObj = JObject.Parse(applicationResult.Application);

            var schemaData   = _schema.ToJson();
            var schemaErrors = _schema.Validate(appObj);

            schemaErrors.Count.Should().Be(0);

            var responseId = int.Parse(appObj.GetValue("id").ToString());

            responseId.Should().Be(applicationId);
        }