Ejemplo n.º 1
0
        public void Test07_CompanysInactiveForXDays_5days()
        {
            //arrange
            // expected value is "TestCompany1", "TestCompany11", "TestCompany2", "TestCompany4"
            List <string> expected = new() { "TestCompany1", "TestCompany11", "TestCompany2", "TestCompany4" };

            //act
            // look for inactive companies since 5 days before 4-25-21 (date of test creation)
            List <string> actual = RssActivity.CompanysInactiveForXDays(rssTestDictionary,
                                                                        5 + DateTime.Now.Subtract(new DateTime(2021, 4, 25, 21, 22, 0)).TotalDays);

            //assert
            Assert.AreEqual(expected, actual, string.Join(",", expected) + " != " + string.Join(",", actual));
        }
Ejemplo n.º 2
0
        public void Test05_CompanysInactiveForXDays_1000days()
        {
            //arrange
            // expected value is empty List of strings
            List <string> expected = new() { };

            //act
            // look for inactive companies since 1000 days before 4-25-21 (date of test creation)
            List <string> actual = RssActivity.CompanysInactiveForXDays(rssTestDictionary,
                                                                        1000 + DateTime.Now.Subtract(new DateTime(2021, 4, 25, 21, 12, 0)).TotalDays);

            //assert
            Assert.AreEqual(expected, actual, string.Join(",", expected) + " != " + string.Join(",", actual));
        }
Ejemplo n.º 3
0
        public void Test10_CompanysInactiveForXDays_NullDictionary()
        {
            //arrange
            // expected value is an empty List of strings
            List <string> expected = new();

            //act
            // look for inactive companies since 0 days before 4-25-21 (date of test creation)
            // pass null rssDictionary
            List <string> actual = RssActivity.CompanysInactiveForXDays(null,
                                                                        0 + DateTime.Now.Subtract(new DateTime(2021, 4, 25, 21, 27, 0)).TotalDays);

            //assert
            Assert.AreEqual(expected, actual, string.Join(",", expected) + " != " + string.Join(",", actual));
        }
Ejemplo n.º 4
0
        public void Test08_CompanysInactiveForXDays_0days()
        {
            //arrange
            // expected value is all company names (keys in dictionary) except TestCompany14 in ascending order
            List <string> expected = rssTestDictionary.Keys
                                     .Where(n => n != "TestCompany14")
                                     .OrderBy(n => n)
                                     .ToList();
            //act
            // look for inactive companies since 0 days before 4-25-21 (date of test creation)
            List <string> actual = RssActivity.CompanysInactiveForXDays(rssTestDictionary,
                                                                        0 + DateTime.Now.Subtract(new DateTime(2021, 4, 25, 21, 27, 0)).TotalDays);

            //assert
            Assert.AreEqual(expected, actual, string.Join(",", expected) + " != " + string.Join(",", actual));
        }