Untitled
unknown
plain_text
2 years ago
970 B
8
Indexable
[Test]
[TestCase("electronics")]
[TestCase("pavan")]
public async Task GetProductsInCategory(string name)
{
var options = new DbContextOptionsBuilder<TemplateContext>()
.UseMySql(ConnectionStrings, new MySqlServerVersion(new Version(8, 0, 23)))
.Options;
using (var dbContext = new TemplateContext(options))
{
var repo = new Repo(dbContext);
var result = await repo.GetProductsInCategory(name);
Console.WriteLine(result);
switch (result)
{
case "enter a valid product in the inventory":
case (result != null):
Assert.Pass();
break;
default:
Assert.Fail();
break;
}
}
}
Editor is loading...
Leave a Comment