示例#1
0
        public void Hide_NullListThrowsException()
        {
            //Arrange
            IfNoSubItemsInInstantPackageHide testObject = new IfNoSubItemsInInstantPackageHide(new TestCache());
            List <IItemKey> nullSubItems = null;

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => testObject.Hide(nullSubItems));
        }
示例#2
0
        public void Hide_NoSubItemsEmptyPackageReturnsTrue()
        {
            //Arrange
            IfNoSubItemsInInstantPackageHide testObject = new IfNoSubItemsInInstantPackageHide(new TestCache());
            List <IItemKey> subItems = new List <IItemKey>()
            {
            };

            //Act
            bool hidden = testObject.Hide(subItems);

            //Assert
            Assert.IsTrue(hidden);
        }
示例#3
0
        public void Hide_NoSubItemsPopulatedPackageReturnsTrue()
        {
            //Arrange
            IfNoSubItemsInInstantPackageHide testObject = new IfNoSubItemsInInstantPackageHide(new TestCache());

            _testInstantPackageManager.AddItem(_testItemKey5);
            List <IItemKey> subItems = new List <IItemKey>()
            {
            };

            //Act
            bool hidden = testObject.Hide(subItems);

            //Assert
            Assert.IsTrue(hidden);
        }
示例#4
0
        public void Hide_PopulatedPackageDoesNotContainAnySubItemReturnsTrue()
        {
            //Arrange
            IfNoSubItemsInInstantPackageHide testObject = new IfNoSubItemsInInstantPackageHide(new TestCache());
            List <IItemKey> subItems = new List <IItemKey>()
            {
                _testSubItemKey1, _testSubItemKey2, _testSubItemKey3, _testSubItemKey4
            };

            _testInstantPackageManager.AddItem(_testItemKey5);

            //Act
            bool hidden = testObject.Hide(subItems);

            //Assert
            Assert.IsTrue(hidden);
        }
示例#5
0
        public void Hide_ContainsSomeSubItemReturnsFalse()
        {
            //Arrange
            IfNoSubItemsInInstantPackageHide testObject = new IfNoSubItemsInInstantPackageHide(new TestCache());
            List <IItemKey> subItems = new List <IItemKey>()
            {
                _testSubItemKey1, _testSubItemKey2, _testSubItemKey3, _testSubItemKey4
            };

            _testInstantPackageManager.AddItem(_testSubItemKey1);
            _testInstantPackageManager.AddItem(_testSubItemKey2);
            _testInstantPackageManager.AddItem(_testItemKey5);

            //Act
            bool hidden = testObject.Hide(subItems);

            //Assert
            Assert.IsFalse(hidden);
        }