public void CacheKey_CheckVaryParamsFromNullAnonimousType_Test() { //arrange string keyName = "fakeName"; object varyParams = null; //act CacheKey key = new CacheKey(keyName, varyParams); string result = key.GetCacheKey(); //assert Assert.AreEqual(result, string.Format("{0}#", keyName)); }
public void CacheKey_CheckVaryParamsFromAnonimousType_Test() { //arrange string keyName = "fakeName"; object varyParams = new { PropertyA = "ParamA", PropertyB = 2 }; //act CacheKey key = new CacheKey(keyName, varyParams); string result = key.GetCacheKey(); string expected = string.Format("{0}#{1};{2};{3};{4}", keyName, "PropertyA", "ParamA", "PropertyB", "2"); //assert Assert.AreEqual(result, expected); }