Пример #1
0
        public void Read_NotExistFile_Should_Return_Empty()
        {
            InitDataContext initDataContext  = new InitDataContext();
            var             mockFileDbHelper = new MockFileDbHelper();

            initDataContext.FileDbHelper = mockFileDbHelper;

            var mockItems = initDataContext.Read <MockNotExistItem>();

            mockItems.ShouldNotNull();
            mockItems.Count.ShouldEqual(0);
        }
Пример #2
0
        public void Save_Should_Replace()
        {
            InitDataContext initDataContext  = new InitDataContext();
            var             mockFileDbHelper = new MockFileDbHelper();

            initDataContext.FileDbHelper = mockFileDbHelper;

            var mockExistItems = new List <MockExistItem>();

            initDataContext.Save(mockExistItems);

            mockFileDbHelper.MockExistItems.ShouldNotNull();
            mockFileDbHelper.MockExistItems.Count.ShouldEqual(0);
        }