Ejemplo n.º 1
0
        public void List_VerifyFileDataAccess()
        {
            var fakeConfig         = MakeFakeConfig();
            var mockFileDataAccess = new MockIFileDataAccess <BlogUser>();
            var fileAdapter        = new BlogUserFileAdapter(fakeConfig, mockFileDataAccess);
            var stub_blogUser      = new BlogUserFactory().Create();
            var stub_list          = new List <BlogUser> {
                stub_blogUser
            };

            mockFileDataAccess.StubReadDatabase(stub_list);
            var expected_readDBfilePath = fakeConfig[KeyChain.FileDataAccess_BlogUser_DatabasePath];

            fileAdapter.List();

            mockFileDataAccess.VerifyReadDatabase(expected_readDBfilePath);
        }
Ejemplo n.º 2
0
        public void List_ReturnsExpectedList()
        {
            var fakeConfig         = MakeFakeConfig();
            var stubFileDataAccess = new StubIFileDataAccess <BlogUser>();
            var fileAdapter        = new BlogUserFileAdapter(fakeConfig, stubFileDataAccess);
            var stub_blogUser      = new BlogUserFactory().Create();
            var stub_list          = new List <BlogUser> {
                stub_blogUser
            };

            stubFileDataAccess.StubReadDatabase(stub_list);
            var expected = stub_list;

            var actual = fileAdapter.List();

            Assert.Equal(expected, actual);
        }