Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LoanFormShould
- {
- [Fact]
- public async Task RenderApplicationForm()
- {
- // Creating a web Host Builder to put in your test server
- var builder = new WebHostBuilder()
- .UseContentRoot(@"Enter your Path here to project")
- .UseEnvironment("Development")
- .UseStartup<loans.Startup>()
- .UseApplicationInsights(); // Only need this if your using that feature
- var server = new TestServer(builder);
- var client = server.CreateClient(); // creating a client to make a request
- var response = await client.GetAsync("/Apply");
- response.EnsureSuccessStatusCode();
- var responseString = await response.Content.ReadAsStringAsync(); // Getting the string of HTML
- Assert.Contains("New Loan Application", responseString); // Using the Assert Contains to see if the has the right title
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement