コード例 #1
0
        public void ConvertToRouteValueDictionary_WithNull_ReturnsNull()
        {
            // Arrange, Act
            var dictionary = RouteValueDictionaryExtensions.ConvertToRouteValueDictionary(null);

            // Assert
            PAssert.IsTrue(() => dictionary == null);
        }
コード例 #2
0
        public void ConvertToRouteValueDictionary_WithObjectDictionary_ReturnsPopulatedDictionary()
        {
            // Arrange
            var routeValues = new { foo = "bar" };

            // Act
            var dictionary = RouteValueDictionaryExtensions.ConvertToRouteValueDictionary(routeValues);

            // Assert
            PAssert.IsTrue(() => (string)dictionary["foo"] == "bar");
        }
コード例 #3
0
        public void ConvertToRouteValueDictionary_WithObjectThatIsDictionary_JustReturnsObjectCastToDictionary()
        {
            // Arrange
            object routeValues = new RouteValueDictionary();

            // Act
            var dictionary = RouteValueDictionaryExtensions.ConvertToRouteValueDictionary(routeValues);

            // Assert
            PAssert.IsTrue(() => routeValues == dictionary);
        }