Ejemplo n.º 1
0
        public void ControllerInsensitiveWithDifferentParamTest()
        {
            var cas1 = new ControllerActionSignature("Get", new[] { typeof(int) });
            var cas2 = new ControllerActionSignature("Values", "get", new[] { typeof(string) });

            Assert.False(cas1 == cas2);
        }
        public void ImplicitConvertWithOneParameterTest()
        {
            ControllerActionSignature cas = "values.get(int)";

            Assert.True(cas.ControllerName == "values");
            Assert.True(cas.ActionName == "get");
            Assert.Single(cas.ParameterTypes);
            Assert.True(cas.ParameterTypes.First().Equals(typeof(int)));
        }
        public void ImplicitConvertWithMultipleParametersTest()
        {
            ControllerActionSignature cas = "values.get(int ,  string   ,    double?)";

            Assert.True(cas.ControllerName == "values");
            Assert.True(cas.ActionName == "get");
            Assert.Equal(3, cas.ParameterTypes.Count());
            Assert.True(cas.ParameterTypes.First().Equals(typeof(int)));
            Assert.True(cas.ParameterTypes.Skip(1).Take(1).First().Equals(typeof(string)));
            Assert.True(cas.ParameterTypes.Last().Equals(typeof(double?)));
        }