Exemplo n.º 1
0
        private async Task <ApiStoreResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiStoreRequestModel();

            model.SetProperties("B", DateTime.Parse("1/1/1988 12:00:00 AM"), "B", Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"), 1);
            CreateResponse <ApiStoreResponseModel> result = await client.StoreCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
Exemplo n.º 2
0
        public void MapModelToBO()
        {
            var mapper = new BOLStoreMapper();
            ApiStoreRequestModel model = new ApiStoreRequestModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1);
            BOStore response = mapper.MapModelToBO(1, model);

            response.Demographic.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.SalesPersonID.Should().Be(1);
        }
Exemplo n.º 3
0
        public void CreatePatch()
        {
            var mapper = new ApiStoreModelMapper();
            var model  = new ApiStoreRequestModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1);

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

            patch.ApplyTo(response);
            response.Demographic.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.SalesPersonID.Should().Be(1);
        }