public void GetAllClients_Test() { Client client = new Client() { Name = "TestClient", Symbol = "TestSymbol", NIP = "3234321234", State = "TestState", City = "TestCity", Street = "TestStreet", PostalCode = "11-111", Phone = "123-123-123", Email = "*****@*****.**", RevenueId = 1, Revenue = new Revenue() { Name = "TestRevenue", City = "TestCity", Street = "TestStreet" } }; //Arrange var mock = new Mock <IDbContext>(); mock.Setup(x => x.Set <Client>()) .Returns(new FakeDbSet <Client> { client }); // Act ClientViewModel dvm = new ClientViewModel(null, mock.Object); var allClients = dvm.GetDataFromDB(mock.Object); // Assert Assert.AreEqual(1, allClients.Count()); }