IGNITE-7691 .NET: Add attribute-based Scale and Precision tests

Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8cb69174
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8cb69174
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8cb69174

Branch: refs/heads/ignite-7708
Commit: 8cb69174338b3f62c11092ca89baa736f0b24989
Parents: 0991437
Author: Pavel Tupitsyn <ptupit...@apache.org>
Authored: Sun Apr 15 01:34:30 2018 +0300
Committer: Pavel Tupitsyn <ptupit...@apache.org>
Committed: Sun Apr 15 01:34:30 2018 +0300

----------------------------------------------------------------------
 .../Cache/Query/CacheQueriesCodeConfigurationTest.cs        | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8cb69174/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
----------------------------------------------------------------------
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
index a05923d..1d03c68 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
@@ -118,6 +118,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             Assert.AreEqual(typeof(AttributeTest), qe.ValueType);
 
             var fields = qe.Fields.ToArray();
+            var idxField = fields.Single(x => x.Name == "IndexedField1");
 
             CollectionAssert.AreEquivalent(new[]
             {
@@ -126,7 +127,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             }, fields.Select(x => x.Name));
 
             Assert.IsTrue(fields.Single(x => x.Name == "SqlField").NotNull);
-            Assert.IsFalse(fields.Single(x => x.Name == 
"IndexedField1").NotNull);
+            Assert.IsFalse(idxField.NotNull);
 
             var idx = qe.Indexes.ToArray();
 
@@ -144,6 +145,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             Assert.AreEqual(-1, idx[1].InlineSize);
             Assert.AreEqual(513, idx[2].InlineSize);
             Assert.AreEqual(-1, idx[3].InlineSize);
+            
+            Assert.AreEqual(3, idxField.Precision);
+            Assert.AreEqual(4, idxField.Scale);
         }
 
         /// <summary>
@@ -320,7 +324,8 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             [QuerySqlField(NotNull = true)]
             public double SqlField { get; set; }
 
-            [QuerySqlField(IsIndexed = true, Name = "IndexedField1", 
IsDescending = true, IndexInlineSize = 513)]
+            [QuerySqlField(IsIndexed = true, Name = "IndexedField1", 
IsDescending = true, IndexInlineSize = 513,
+                DefaultValue = 42, Precision = 3, Scale = 4)]
             public int IndexedField { get; set; }
 
             [QueryTextField]

Reply via email to