Skip to content

Instantly share code, notes, and snippets.

View executeautomation's full-sized avatar
:octocat:
Executing

ExecuteAutomation executeautomation

:octocat:
Executing
View GitHub Profile
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:63256",
"sslPort": 44330
}
},
[Fact]
public void TestRegisterUserWithType()
{
var driver = webDriverFixture.ChromeDriver;
testOutputHelper.WriteLine("First test");
driver
.Navigate()
.GoToUrl("http://eaapp.somee.com");
var fixture = new Fixture();
[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>();
[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");
public static IEnumerable<object[]> Data => new List<object[]>
{
new object[]
{
"Karthik",
"kartPassword",
"kartPassword",
"karthik@gmail.com"
},
new object[]
[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
public class DataRepository : IDataRepository
{
private readonly EmployeeDbContext db;
public DataRepository(EmployeeDbContext db)
{
this.db = db;
}
public List<Employee> GetEmployees() => db.Employee.ToList();
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);
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())
{
public class DataSeeder
{
private readonly EmployeeDbContext employeeDbContext;
public DataSeeder(EmployeeDbContext employeeDbContext)
{
this.employeeDbContext = employeeDbContext;
}
public void Seed()