public void given_information() { this.Customer = DataSeedUtil.CreateCustomer(this._client); this.Product = DataSeedUtil.CreateProduct(this._client, this.Customer); this.Source = DataSeedUtil.CreateSource(this._client, this.Product); this.Threat = DataSeedUtil.CreateSecurityThreat(this._client); }
public void when_send_request() { int sourceId = this.Source.Id; var period = DataSeedUtil.JanuaryPeriod(); var representation = Builder <SourceItemAvailabilityPostRp> .CreateNew() .With(x => x.SourceId = sourceId) .With(x => x.Start = period.start) .With(x => x.End = period.end) .With(x => x.Measure = 0.9m) .Build(); var jsonContent = HttpClientExtension.ParseModelToHttpContent(representation); var responsePost = this._client.PostAsync($"/sourceItems/availability", jsonContent).Result; Assert.Equal(StatusCodes.Status200OK, (int)responsePost.StatusCode); }