예제 #1
0
        public void ProjectCache_Update_With_Empty_List()
        {
            // Arrange
            var expected = 0;
            var ps       = BaseTests.PrepPowerShell();

            ProjectCache.Cache.Shell = ps;

            // Act
            ProjectCache.Update(new List <string>());

            // Assert
            Assert.AreEqual(expected, ProjectCache.Cache.Values.Count);
        }
예제 #2
0
        public void ProjectCache_Update_Returns_Null()
        {
            // Arrange
            var expected = 0;
            var ps       = BaseTests.PrepPowerShell();

            ProjectCache.Cache.Shell = ps;

            // Act
            ProjectCache.Update(null);

            // Assert
            Assert.AreEqual(expected, ProjectCache.Cache.Values.Count);
        }
예제 #3
0
        public void ProjectCache_Update_With_Null_List()
        {
            // Arrange
            var expected = 2;
            var ps       = BaseTests.PrepPowerShell();

            ps.Invoke <string>().Returns(this._templates);
            ProjectCache.Cache.Shell = ps;

            // Act
            ProjectCache.Update(null);

            // Assert
            Assert.AreEqual(expected, ProjectCache.Cache.Values.Count);
        }
예제 #4
0
        public void ProjectCache_HasCacheExpired()
        {
            // Arrange
            var expected = true;

            // Act
            ProjectCache.Invalidate();

            // Assert
            Assert.AreEqual(expected, ProjectCache.HasCacheExpired, "Cache should be expired");

            // Act
            ProjectCache.Update(new List <string>());

            // Assert
            Assert.AreNotEqual(expected, ProjectCache.HasCacheExpired, "Cache should not be expired");
        }