public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiUserClientResponseModel response = await client.UserGetAsync(1); response.Should().NotBeNull(); 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.UserId.Should().Be(1); response.Username.Should().Be("A"); response.Website.Should().Be("A"); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiUserClientResponseModel response = await client.UserGetAsync(1); response.Should().NotBeNull(); 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.Id.Should().Be(1); 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 MapClientResponseToRequest() { var mapper = new ApiUserModelMapper(); var model = new ApiUserClientResponseModel(); model.SetProperties(1, "A", "A"); ApiUserClientRequestModel response = mapper.MapClientResponseToRequest(model); response.Should().NotBeNull(); response.Password.Should().Be("A"); response.Username.Should().Be("A"); }
public virtual async void TestGetNotFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApiUserClientResponseModel response = await client.UserGetAsync(default(int)); response.Should().BeNull(); }
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); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiUserClientResponseModel response = await client.UserGetAsync(1); response.Should().NotBeNull(); response.Id.Should().Be(1); response.Password.Should().Be("A"); response.Username.Should().Be("A"); }
public void MapClientResponseToRequest() { var mapper = new ApiUserModelMapper(); var model = new ApiUserClientResponseModel(); model.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", "A", 1, "A", "A", "A", "A", "A"); ApiUserClientRequestModel response = mapper.MapClientResponseToRequest(model); response.Should().NotBeNull(); 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"); }
public void MapClientResponseToRequest() { var mapper = new ApiUserModelMapper(); var model = new ApiUserClientResponseModel(); 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"); ApiUserClientRequestModel response = mapper.MapClientResponseToRequest(model); response.Should().NotBeNull(); 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"); }