private async Task <ApiApiKeyResponseModel> CreateRecord() { var model = new ApiApiKeyRequestModel(); model.SetProperties("B", DateTimeOffset.Parse("1/1/1988 12:00:00 AM"), "B", "B"); CreateResponse <ApiApiKeyResponseModel> result = await this.Client.ApiKeyCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapModelToBO() { var mapper = new BOLApiKeyMapper(); ApiApiKeyRequestModel model = new ApiApiKeyRequestModel(); model.SetProperties("A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A"); BOApiKey response = mapper.MapModelToBO("A", model); response.ApiKeyHashed.Should().Be("A"); response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.JSON.Should().Be("A"); response.UserId.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiApiKeyModelMapper(); var model = new ApiApiKeyRequestModel(); model.SetProperties("A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A"); JsonPatchDocument <ApiApiKeyRequestModel> patch = mapper.CreatePatch(model); var response = new ApiApiKeyRequestModel(); patch.ApplyTo(response); response.ApiKeyHashed.Should().Be("A"); response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.JSON.Should().Be("A"); response.UserId.Should().Be("A"); }