Beispiel #1
0
 public void Setup()
 {
     _testData     = DataHelpers.GetSampleTableColumnInfoRaw();
     _listToRemove = new List <string>()
     {
         "RemoveDueToCtorParameter"
     };
     _biz = new TableExcluderList(_listToRemove);
 }
Beispiel #2
0
        public void TableExcluderList_RemoveTables_RemovesTableFromClassList()
        {
            // Arrange
            int    expectedTestDataCount = 7;
            string tableShouldBeRemoved  = "aspnet_Paths";

            _biz = new TableExcluderList(null);

            // Relying on specific data - if the count does not match, fail - not a perfect test by any means, but should help
            if (_testData.Count != expectedTestDataCount)
            {
                Assert.Fail("Test data count different than expected");
            }

            // Act
            var results = _biz.RemoveTables(_testData);

            // Assert
            Assert.AreEqual(expectedTestDataCount - 1, results.Count(), string.Format("results count expected to be one less than {0}", nameof(expectedTestDataCount)));
            Assert.IsTrue(_testData.Select(s => s.TableName).Contains(tableShouldBeRemoved), string.Format("Test data issue - {0} should be contained within list", tableShouldBeRemoved));
            Assert.IsFalse(results.Select(s => s.TableName).Contains(tableShouldBeRemoved), string.Format("{0} should not be contained within list after removal operation", tableShouldBeRemoved));
        }