Exemplo n.º 1
0
        public void ToStringTranslator_finds_all_expected_types()
        {
            var types = new ExpressionConverter.MethodCallTranslator.ToStringTranslator().Methods.Select(m => m.DeclaringType).ToArray();

            Assert.Contains(typeof(bool), types);
            Assert.Contains(typeof(byte), types);
            Assert.Contains(typeof(sbyte), types);
            Assert.Contains(typeof(short), types);
            Assert.Contains(typeof(int), types);
            Assert.Contains(typeof(long), types);
            Assert.Contains(typeof(float), types);
            Assert.Contains(typeof(double), types);
            Assert.Contains(typeof(decimal), types);
            Assert.Contains(typeof(string), types);
            Assert.Contains(typeof(Guid), types);
            Assert.Contains(typeof(TimeSpan), types);
            Assert.Contains(typeof(DateTime), types);
            Assert.Contains(typeof(DateTimeOffset), types);
            Assert.Contains(typeof(object), types);

            Assert.Equal(15, types.Length);
        }
        public void ToStringTranslator_finds_all_expected_types()
        {
            var types = new ExpressionConverter.MethodCallTranslator.ToStringTranslator().Methods.Select(m => m.DeclaringType).ToArray();

            Assert.Contains(typeof(bool), types);
            Assert.Contains(typeof(byte), types);
            Assert.Contains(typeof(sbyte), types);
            Assert.Contains(typeof(short), types);
            Assert.Contains(typeof(int), types);
            Assert.Contains(typeof(long), types);
            Assert.Contains(typeof(float), types);
            Assert.Contains(typeof(double), types);
            Assert.Contains(typeof(decimal), types);
            Assert.Contains(typeof(string), types);
            Assert.Contains(typeof(Guid), types);
            Assert.Contains(typeof(TimeSpan), types);
            Assert.Contains(typeof(DateTime), types);
            Assert.Contains(typeof(DateTimeOffset), types);
            Assert.Contains(typeof(object), types);

            Assert.Equal(15, types.Length);
        }