Exemplo n.º 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiPersonModelMapper();
            var model  = new ApiPersonResponseModel();

            model.SetProperties(1, "A");
            ApiPersonRequestModel response = mapper.MapResponseToRequest(model);

            response.PersonName.Should().Be("A");
        }
Exemplo n.º 2
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiPersonModelMapper();
            var model  = new ApiPersonResponseModel();

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

            response.AdditionalContactInfo.Should().Be("A");
            response.Demographic.Should().Be("A");
            response.EmailPromotion.Should().Be(1);
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.MiddleName.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.NameStyle.Should().Be(true);
            response.PersonType.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Suffix.Should().Be("A");
            response.Title.Should().Be("A");
        }
Exemplo n.º 3
0
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            ApiPersonResponseModel model = await client.PersonGetAsync(1);

            ApiPersonModelMapper mapper = new ApiPersonModelMapper();

            UpdateResponse <ApiPersonResponseModel> updateResponse = await client.PersonUpdateAsync(model.BusinessEntityID, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }
Exemplo n.º 4
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiPersonModelMapper mapper = new ApiPersonModelMapper();

            UpdateResponse <ApiPersonResponseModel> updateResponse = await this.Client.PersonUpdateAsync(model.PersonId, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }