コード例 #1
0
        public void ShouldSetMethodParameterAndDeclaredType()
        {
            var target = new OptionalParameterTarget(TestMethod_OptionalStringWithDefault_Info.GetParameters()[0]);

            Assert.NotNull(target.MethodParameter);
            Assert.Equal(typeof(string), target.DeclaredType);
        }
コード例 #2
0
        public void ShouldCorrectlyUseDefaultIntForOptionalArgWithNoDefault()
        {
            var target = new OptionalParameterTarget(TestMethod_OptionalIntWithNoDefault_Info.GetParameters()[0]);

            Assert.Equal(0, target.Value);
        }
コード例 #3
0
        public void ShouldCorrectlyUseStringArgumentWithDefault()
        {
            var target = new OptionalParameterTarget(TestMethod_OptionalStringWithDefault_Info.GetParameters()[0]);

            Assert.Equal("hello world", target.Value);
        }