mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
28 lines
516 B
C#
28 lines
516 B
C#
|
|
using Packt.Shared; // NorthwindContext
|
||
|
|
|
||
|
|
namespace Northwind.Common.UnitTests
|
||
|
|
{
|
||
|
|
public class EntityModelTests
|
||
|
|
{
|
||
|
|
[Fact]
|
||
|
|
public void DatabaseConnectTest()
|
||
|
|
{
|
||
|
|
using (NorthwindContext db = new())
|
||
|
|
{
|
||
|
|
Assert.True(db.Database.CanConnect());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[Fact]
|
||
|
|
public void CategoryCountTest()
|
||
|
|
{
|
||
|
|
using (NorthwindContext db = new())
|
||
|
|
{
|
||
|
|
int expected = 8;
|
||
|
|
int actual = db.Categories.Count();
|
||
|
|
|
||
|
|
Assert.Equal(expected, actual);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|