public void WhenGettingBrandsFromDb_GetsBrands() { // Mock CarLogic logic = new CarLogic(); logic.SetRepositoryInterface(this.mockedRepository.Object); // Act var result = logic.ListBrandLogic(); // Assert Assert.That(result.Count(), Is.EqualTo(3)); Assert.That(result.SingleOrDefault(x => x.name == "Ferari"), Is.Not.Null); }