示例#1
0
 public static ItemRepMock Get()
 {
     if (_instance == null)
     {
         _instance = new ItemRepMock();
     }
     return(_instance);
 }
示例#2
0
        /// <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);
        }