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()); ApiFamilyClientResponseModel response = await client.FamilyGetAsync(default(int)); response.Should().BeNull(); }
public void MapClientResponseToRequest() { var mapper = new ApiFamilyModelMapper(); var model = new ApiFamilyClientResponseModel(); model.SetProperties(1, "A", "A", "A", "A", "A"); ApiFamilyClientRequestModel response = mapper.MapClientResponseToRequest(model); response.Should().NotBeNull(); response.Notes.Should().Be("A"); response.PrimaryContactEmail.Should().Be("A"); response.PrimaryContactFirstName.Should().Be("A"); response.PrimaryContactLastName.Should().Be("A"); response.PrimaryContactPhone.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; ApiFamilyClientResponseModel response = await client.FamilyGetAsync(1); response.Should().NotBeNull(); response.Id.Should().Be(1); response.Notes.Should().Be("A"); response.PrimaryContactEmail.Should().Be("A"); response.PrimaryContactFirstName.Should().Be("A"); response.PrimaryContactLastName.Should().Be("A"); response.PrimaryContactPhone.Should().Be("A"); }