public void ProcessTemplateCache_Update_With_Empty_List() { // Arrange var expected = 0; var ps = BaseTests.PrepPowerShell(); ProcessTemplateCache.Cache.Shell = ps; // Act ProcessTemplateCache.Update(new List <string>()); // Assert Assert.AreEqual(expected, ProcessTemplateCache.Cache.Values.Count); }
public void ProcessTemplateCache_Update_Returns_Null() { // Arrange var expected = 0; var ps = BaseTests.PrepPowerShell(); ProcessTemplateCache.Cache.Shell = ps; // Act ProcessTemplateCache.Update(null); // Assert Assert.AreEqual(expected, ProcessTemplateCache.Cache.Values.Count); }
public void ProcessTemplateCache_Update_With_Null_List() { // Arrange var expected = 5; var ps = BaseTests.PrepPowerShell(); ps.Invoke <string>().Returns(this._items); ProcessTemplateCache.Cache.Shell = ps; // Act ProcessTemplateCache.Update(null); // Assert Assert.AreEqual(expected, ProcessTemplateCache.Cache.Values.Count); }
public void ProcessTemplateCache_HasCacheExpired() { // Arrange var expected = true; // Act ProcessTemplateCache.Invalidate(); // Assert Assert.AreEqual(expected, ProcessTemplateCache.HasCacheExpired, "Cache should be expired"); // Act ProcessTemplateCache.Update(new List <string>()); // Assert Assert.AreNotEqual(expected, ProcessTemplateCache.HasCacheExpired, "Cache should not be expired"); }