示例#1
0
        private async Task <ApiAWBuildVersionResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiAWBuildVersionRequestModel();

            model.SetProperties("B", DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"));
            CreateResponse <ApiAWBuildVersionResponseModel> result = await client.AWBuildVersionCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
示例#2
0
        public void MapModelToBO()
        {
            var mapper = new BOLAWBuildVersionMapper();
            ApiAWBuildVersionRequestModel model = new ApiAWBuildVersionRequestModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"));
            BOAWBuildVersion response = mapper.MapModelToBO(1, model);

            response.Database_Version.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.VersionDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
        public void MapRequestToResponse()
        {
            var mapper = new ApiAWBuildVersionModelMapper();
            var model  = new ApiAWBuildVersionRequestModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"));
            ApiAWBuildVersionResponseModel response = mapper.MapRequestToResponse(1, model);

            response.Database_Version.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.SystemInformationID.Should().Be(1);
            response.VersionDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
        public void CreatePatch()
        {
            var mapper = new ApiAWBuildVersionModelMapper();
            var model  = new ApiAWBuildVersionRequestModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"));

            JsonPatchDocument <ApiAWBuildVersionRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiAWBuildVersionRequestModel();

            patch.ApplyTo(response);
            response.Database_Version.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.VersionDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }