public static PurchaseRepMock Get() { if (_instance == null) { _instance = new PurchaseRepMock(); } return(_instance); }
/// <summary> /// Создать Moq с товарами/группами/магазинами /// </summary> private void defineMockDbContext() { var fBus = EntitiesFactory.Get(); MockExpensesRep = new Mock <IExpensesRepository>(); //репозиторий товаров MockExpensesRep.Setup(m => m.ItemRep).Returns(ItemRepMock.Get().Mock.Object); //репозиторий групп товаров MockExpensesRep.Setup(m => m.GroupRep).Returns(GroupRepMock.Get().GpRepMock.Object); //репозиторий магазинов MockExpensesRep.Setup(m => m.ShopRep).Returns(ShopRepMock.Get().Mock.Object); //репозиторий покупок MockExpensesRep.Setup(m => m.PurchaseRep).Returns(PurchaseRepMock.Get().Mock.Object); }