This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json.schemastore.org/launchsettings.json", | |
"iisSettings": { | |
"windowsAuthentication": false, | |
"anonymousAuthentication": true, | |
"iisExpress": { | |
"applicationUrl": "http://localhost:63256", | |
"sslPort": 44330 | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void TestRegisterUserWithType() | |
{ | |
var driver = webDriverFixture.ChromeDriver; | |
testOutputHelper.WriteLine("First test"); | |
driver | |
.Navigate() | |
.GoToUrl("http://eaapp.somee.com"); | |
var fixture = new Fixture(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void TestRegisterUser() | |
{ | |
var driver = webDriverFixture.ChromeDriver; | |
testOutputHelper.WriteLine("First test"); | |
driver | |
.Navigate() | |
.GoToUrl("http://eaapp.somee.com"); | |
var userName = new Fixture().Create<string>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Theory] | |
[MemberData(nameof(Data))] | |
public void TestRegisterUser(string username, string password, string cpassword, string email) | |
{ | |
var driver = webDriverFixture.ChromeDriver; | |
testOutputHelper.WriteLine("First test"); | |
driver | |
.Navigate() | |
.GoToUrl("http://eaapp.somee.com"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<object[]> Data => new List<object[]> | |
{ | |
new object[] | |
{ | |
"Karthik", | |
"kartPassword", | |
"kartPassword", | |
"[email protected]" | |
}, | |
new object[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Theory] | |
[InlineData("admin", "password")] | |
[InlineData("admin", "password2")] | |
[InlineData("admin", "password3")] | |
[InlineData("admin", "password4")] | |
public void TestLoginWithFillData(string username, string password) | |
{ | |
var driver = webDriverFixture.ChromeDriver; | |
testOutputHelper.WriteLine("First test"); | |
driver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DataRepository : IDataRepository | |
{ | |
private readonly EmployeeDbContext db; | |
public DataRepository(EmployeeDbContext db) | |
{ | |
this.db = db; | |
} | |
public List<Employee> GetEmployees() => db.Employee.ToList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace MiniDemo.Model | |
{ | |
public interface IDataRepository | |
{ | |
List<Employee> AddEmployee(Employee employee); | |
List<Employee> GetEmployees(); | |
Employee PutEmployee(Employee employee); | |
Employee GetEmployeeById(string id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (args.Length == 1 && args[0].ToLower() == "seeddata") | |
SeedData(app); | |
//Seed Data | |
void SeedData(IHost app) | |
{ | |
var scopedFactory = app.Services.GetService<IServiceScopeFactory>(); | |
using (var scope = scopedFactory.CreateScope()) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DataSeeder | |
{ | |
private readonly EmployeeDbContext employeeDbContext; | |
public DataSeeder(EmployeeDbContext employeeDbContext) | |
{ | |
this.employeeDbContext = employeeDbContext; | |
} | |
public void Seed() |
NewerOlder