Example #1
0
        private static void CheckInvalidCacheControlLength(string input, int startIndex)
        {
            CacheControlHeaderValue result = null;

            Assert.Equal(0, CacheControlHeaderValue.GetCacheControlLength(input, startIndex, null, out result));
            Assert.Null(result);
        }
Example #2
0
        private static void CheckGetCacheControlLength(string input, int startIndex, CacheControlHeaderValue storeValue,
                                                       int expectedLength, CacheControlHeaderValue expectedResult)
        {
            CacheControlHeaderValue result = null;

            Assert.Equal(expectedLength, CacheControlHeaderValue.GetCacheControlLength(input, startIndex, storeValue, out result));

            if (storeValue == null)
            {
                Assert.Equal(expectedResult, result);
            }
            else
            {
                // If we provide a 'storeValue', then that instance will be updated and result will be 'null'
                Assert.Null(result);
                Assert.Equal(expectedResult, storeValue);
            }
        }