public void GetVersion_Should_Return_Correct_Version() { string version; cache.Expect(c => c.TryGet(It.IsAny <string>(), out version)).Returns(false); cache.Expect(c => c.Contains(It.IsAny <string>())).Returns(false); cache.Expect(c => c.Set(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DateTime>())); var assetSettings = new AssetSettingsSection { CacheDurationInDays = 10, Compress = true, Version = "1.5" }; assetSettings.Assets.Add(new AssetElement { Name = "js" }); configurationManager.Expect(c => c.GetSection <AssetSettingsSection>(It.IsAny <string>())).Returns(assetSettings); string result = AssetHandler.GetVersion("js"); Assert.Equal("1.5", result); }