Example #1
0
        public void TestHashManyKnownTypeSuccess() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "1",
                        "Anything",
                        "Nothing"
                    }
                }
            };

            Assert.IsTrue(parameter.HasMany<String>(false));
        }
Example #2
0
        public void TestHasManyEnumConversionFailed() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "Six",
                        "Seven",
                        "Invalid"
                    }
                }
            };

            Assert.IsFalse(parameter.HasMany<ExecutableEnum>());
        }
Example #3
0
        public void TestHasManyGuidConversionFailed() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "9D2B0228-4D0D-4C23-8B49-01A698857709",
                        "f380eb1e-1438-48c0-8c3d-ad55f2d40538",
                        "Invalid"
                    }
                }
            };

            Assert.IsFalse(parameter.HasMany<Guid>());
        }
Example #4
0
        public void TestHasManyDateTimeConversionFailed() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "2014-04-14 13:50:59",
                        "2014-04-11 03:23:13",
                        "Invalid"
                    }
                }
            };

            Assert.IsFalse(parameter.HasMany<DateTime>());
        }
Example #5
0
        public void TestHasManyDateTimeConversionSuccess() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "2014-04-14 13:50:59",
                        "2014-04-11 03:23:13"
                    }
                }
            };

            Assert.IsTrue(parameter.HasMany<DateTime>());
        }
Example #6
0
        public void TestHasManyEnumConversionSuccess() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "Six",
                        "Seven"
                    }
                }
            };

            Assert.IsTrue(parameter.HasMany<ExecutableEnum>());
        }
Example #7
0
        public void TestHasManyIntegerConversionSuccess() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "1",
                        "2"
                    }
                }
            };

            Assert.IsTrue(parameter.HasMany<int>());
        }
Example #8
0
        public void TestHasManyIntegerConversionFailed() {
            var parameter = new CommandParameter() {
                Data = {
                    Content = new List<String>() {
                        "1",
                        "2",
                        "Invalid"
                    }
                }
            };

            Assert.IsFalse(parameter.HasMany<int>());
        }