private BlackListViewModel CreateSearchDblackListViewModel()
 {
     var mockDBProvider = new MockDatabaseProvider();
     var list = new[] { "TN 00 0000", "TN 00 1234" };
     mockDBProvider.BlackListItems = (from s in list
                                      select new BlackListItem(s)).ToList();
     return new BlackListViewModel(new DataAccessLayer(mockDBProvider));
 }
예제 #2
0
        private static DataAccessLayer ConstructMockDataAccessLayer()
        {
            var mockDatabaseProvider = new MockDatabaseProvider();
            var list = new[] { "TN 00 0000", "TN 00 1234" };
            mockDatabaseProvider.BlackListItems = (from s in list
                                                   select new BlackListItem(s)).ToList();

            var dataAccessLayer = new DataAccessLayer(mockDatabaseProvider);
            return dataAccessLayer;
        }
 public void TestAddEmptyBlacklistItem()
 {
     var mockDBProvider = new MockDatabaseProvider();
     var blackListItemViewModel = new BlackListViewModel(new DataAccessLayer(mockDBProvider))
     {
         AddVehicleNumber = string.Empty
     };
     blackListItemViewModel.CmdAddBlackListedItem.Execute(null);
     Assert.AreEqual(mockDBProvider.BlackListItems.Count, 0);
 }