Example #1
0
        public void CreatePatch()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserRequestModel();

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

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

            patch.ApplyTo(response);
            response.AboutMe.Should().Be("A");
            response.AccountId.Should().Be(1);
            response.Age.Should().Be(1);
            response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.DisplayName.Should().Be("A");
            response.DownVote.Should().Be(1);
            response.EmailHash.Should().Be("A");
            response.LastAccessDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Location.Should().Be("A");
            response.Reputation.Should().Be(1);
            response.UpVote.Should().Be(1);
            response.View.Should().Be(1);
            response.WebsiteUrl.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserRequestModel();

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

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

            patch.ApplyTo(response);
            response.BioImgUrl.Should().Be("A");
            response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ContentDescription.Should().Be("A");
            response.Email.Should().Be("A");
            response.FullName.Should().Be("A");
            response.HeaderImgUrl.Should().Be("A");
            response.Interest.Should().Be("A");
            response.LocationLocationId.Should().Be(1);
            response.Password.Should().Be("A");
            response.PhoneNumber.Should().Be("A");
            response.Privacy.Should().Be("A");
            response.Username.Should().Be("A");
            response.Website.Should().Be("A");
        }
Example #3
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserResponseModel();

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

            response.Password.Should().Be("A");
            response.Username.Should().Be("A");
        }
        public void MapClientRequestToResponse()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserClientRequestModel();

            model.SetProperties("A", "A");
            ApiUserClientResponseModel response = mapper.MapClientRequestToResponse(1, model);

            response.Should().NotBeNull();
            response.Password.Should().Be("A");
            response.Username.Should().Be("A");
        }
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiUserModelMapper mapper = new ApiUserModelMapper();

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

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

            await this.Cleanup();
        }
Example #6
0
        public void MapClientResponseToRequest()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserClientResponseModel();

            model.SetProperties(1, "A", "A", "A", 1);
            ApiUserClientRequestModel response = mapper.MapClientResponseToRequest(model);

            response.Should().NotBeNull();
            response.Email.Should().Be("A");
            response.Password.Should().Be("A");
            response.StripeCustomerId.Should().Be("A");
            response.SubscriptionTypeId.Should().Be(1);
        }
Example #7
0
        public void CreatePatch()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserRequestModel();

            model.SetProperties("A", "A");

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

            patch.ApplyTo(response);
            response.Password.Should().Be("A");
            response.Username.Should().Be("A");
        }
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

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

            ApiUserResponseModel model = await client.UserGetAsync(1);

            ApiUserModelMapper mapper = new ApiUserModelMapper();

            UpdateResponse <ApiUserResponseModel> updateResponse = await client.UserUpdateAsync(model.UserId, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }
        public void MapResponseToRequest()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserResponseModel();

            model.SetProperties("A", "A", "A", "A", "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), true, true, "A", "A");
            ApiUserRequestModel response = mapper.MapResponseToRequest(model);

            response.DisplayName.Should().Be("A");
            response.EmailAddress.Should().Be("A");
            response.ExternalId.Should().Be("A");
            response.ExternalIdentifiers.Should().Be("A");
            response.IdentificationToken.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.IsActive.Should().Be(true);
            response.IsService.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Username.Should().Be("A");
        }
        public void CreatePatch()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserRequestModel();

            model.SetProperties("A", "A", "A", "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), true, true, "A", "A");

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

            patch.ApplyTo(response);
            response.DisplayName.Should().Be("A");
            response.EmailAddress.Should().Be("A");
            response.ExternalId.Should().Be("A");
            response.ExternalIdentifiers.Should().Be("A");
            response.IdentificationToken.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.IsActive.Should().Be(true);
            response.IsService.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Username.Should().Be("A");
        }
Example #11
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserResponseModel();

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

            response.AboutMe.Should().Be("A");
            response.AccountId.Should().Be(1);
            response.Age.Should().Be(1);
            response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.DisplayName.Should().Be("A");
            response.DownVote.Should().Be(1);
            response.EmailHash.Should().Be("A");
            response.LastAccessDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Location.Should().Be("A");
            response.Reputation.Should().Be(1);
            response.UpVote.Should().Be(1);
            response.View.Should().Be(1);
            response.WebsiteUrl.Should().Be("A");
        }
Example #12
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiUserModelMapper();
            var model  = new ApiUserResponseModel();

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

            response.BioImgUrl.Should().Be("A");
            response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ContentDescription.Should().Be("A");
            response.Email.Should().Be("A");
            response.FullName.Should().Be("A");
            response.HeaderImgUrl.Should().Be("A");
            response.Interest.Should().Be("A");
            response.LocationLocationId.Should().Be(1);
            response.Password.Should().Be("A");
            response.PhoneNumber.Should().Be("A");
            response.Privacy.Should().Be("A");
            response.Username.Should().Be("A");
            response.Website.Should().Be("A");
        }