public void MapResponseToRequest()
        {
            var mapper = new ApiCertificateModelMapper();
            var model  = new ApiCertificateResponseModel();

            model.SetProperties("A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), BitConverter.GetBytes(1), "A", "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A");
            ApiCertificateRequestModel response = mapper.MapResponseToRequest(model);

            response.Archived.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.EnvironmentIds.Should().Be("A");
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
            response.NotAfter.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.Subject.Should().Be("A");
            response.TenantIds.Should().Be("A");
            response.TenantTags.Should().Be("A");
            response.Thumbprint.Should().Be("A");
        }
示例#2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiCertificateModelMapper mapper = new ApiCertificateModelMapper();

            UpdateResponse <ApiCertificateResponseModel> updateResponse = await this.Client.CertificateUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }