Beispiel #1
0
        public void then_created()
        {
            var responseGet = this._client.GetAsync($"/sourceItems?sourceId={this.Source.Id}").Result;

            Assert.Equal(StatusCodes.Status200OK, (int)responseGet.StatusCode);
            var responseRepresentation = HttpClientExtension.ParseHttpContentToModel <IEnumerable <SourceItemGetListRp> >(responseGet.Content);

            Assert.Equal(31, responseRepresentation.Count());
        }
        public void then_created()
        {
            var responseGet = this._client.GetAsync($"/risks/security").Result;

            Assert.Equal(StatusCodes.Status200OK, (int)responseGet.StatusCode);
            var responseRepresentation = HttpClientExtension.ParseHttpContentToModel <IEnumerable <SecurityThreatGetRp> >(responseGet.Content);

            Assert.NotEmpty(responseRepresentation);
        }
        public void then_created()
        {
            var responseGet = _client.GetAsync(NewResourceLocation).Result;

            Assert.True(responseGet.IsSuccessStatusCode);

            var FeatureRepresentation = HttpClientExtension.ParseHttpContentToModel <FeatureGetRp>(responseGet.Content);

            Assert.Equal(FeatureRepresentation.Name, representation.Name);
        }
Beispiel #4
0
        public void then_created()
        {
            var responseGet = _client.GetAsync($"/Users?email={representation.Email}").Result;

            Assert.True(responseGet.IsSuccessStatusCode);

            var UserRepresentation = HttpClientExtension.ParseHttpContentToModel <IEnumerable <UserGetListRp> >(responseGet.Content);

            Assert.NotEmpty(UserRepresentation);
        }
        public void when_send_request_with_existing_key()
        {
            var responseGet = _client.GetAsync(NewResourceLocation).Result;

            Assert.Equal((int)responseGet.StatusCode, StatusCodes.Status200OK);

            var CustomerRepresentation = HttpClientExtension.ParseHttpContentToModel <CustomerGetRp>(responseGet.Content);

            Assert.Equal(CustomerRepresentation.Name, NewValue);
        }
        public void when_send_request_with_existing_key()
        {
            var responseGet = _client.GetAsync($"/appsettings/{representation.Key}").Result;

            Assert.Equal((int)responseGet.StatusCode, StatusCodes.Status200OK);

            var appSettingRepresentation = HttpClientExtension.ParseHttpContentToModel <AppSettingPostRp>(responseGet.Content);

            Assert.Equal(appSettingRepresentation.Key, representation.Key);
            Assert.Equal(appSettingRepresentation.Value, NewValue);
        }
        public void when_send_request()
        {
            var jsonContent  = HttpClientExtension.ParseModelToHttpContent(representation);
            var responsePost = _client.PostAsync($"/Squads", jsonContent).Result;

            Assert.Equal(StatusCodes.Status201Created, (int)responsePost.StatusCode);
            NewResourceLocation = responsePost.Headers.Location.ToString();
            var resource = HttpClientExtension.ParseHttpContentToModel <dynamic>(responsePost.Content);

            squadId = (int)resource.id;
        }
        public void then_created()
        {
            var responseGet = _client.GetAsync($"/appsettings/{representation.Key}").Result;

            Assert.True(responseGet.IsSuccessStatusCode);

            var appSettingRepresentation = HttpClientExtension.ParseHttpContentToModel <AppSettingPostRp>(responseGet.Content);

            Assert.Equal(appSettingRepresentation.Key, representation.Key);
            Assert.Equal(appSettingRepresentation.Value, representation.Value);
        }