public void Test_GetQueryableMockDbSet_Empty() { var fakeTableDbSet = MockDbSet.GetQueryableMockDbSet <FakeTable>(@""); _dataContext.Setup(d => d.FakeTables).Returns(fakeTableDbSet.Object); Assert.IsNotNull(_dataContext.Object.FakeTables); }
public void Test_GetQueryableMockDbSet_With_Json() { var fakeTableDbSet = MockDbSet.GetQueryableMockDbSet <FakeTable>(@"test-data.json"); _dataContext.Setup(d => d.FakeTables).Returns(fakeTableDbSet.Object); Assert.IsNotNull(_dataContext.Object.FakeTables); Assert.AreEqual(_dataContext.Object.FakeTables.First().Name, "test-name"); }
public void Test_GetQueryableMockDbSet_With_Enumerable_Objects() { var fakeTableDbSet = MockDbSet.GetQueryableMockDbSet <FakeTable>(new List <FakeTable>() { new FakeTable() { Id = 2, Name = "test-object" } }); _dataContext.Setup(d => d.FakeTables).Returns(fakeTableDbSet.Object); Assert.IsNotNull(_dataContext.Object.FakeTables); Assert.AreEqual(_dataContext.Object.FakeTables.First().Name, "test-object"); Assert.AreEqual(_dataContext.Object.FakeTables.Count(), 1); }