Exemple #1
0
        public void Create_With_MappingDecorated_TimeSeries()
        {
            string createQuery = null;
            var    sessionMock = new Mock <ISession>();

            sessionMock
            .Setup(s => s.Execute(It.IsAny <string>()))
            .Returns(() => new RowSet())
            .Callback <string>(q => createQuery = q);
            var definition = new Cassandra.Mapping.Attributes.AttributeBasedTypeDefinition(typeof(DecoratedTimeSeries));
            var table      = GetTable <DecoratedTimeSeries>(sessionMock.Object, definition);

            table.Create();
            //It contains Ignored props: Ignored1 and Ignored2
            Assert.AreEqual(@"CREATE TABLE ""ks1"".""tbl1"" (""name"" text, ""Slice"" int, ""Time"" timeuuid, ""val"" double, ""Value2"" text, PRIMARY KEY ((""name"", ""Slice""), ""Time""))", createQuery);
        }
 public void Create_With_MappingDecorated_TimeSeries()
 {
     string createQuery = null;
     var sessionMock = new Mock<ISession>();
     sessionMock
         .Setup(s => s.Execute(It.IsAny<string>()))
         .Returns(() => new RowSet())
         .Callback<string>(q => createQuery = q);
     var definition = new Cassandra.Mapping.Attributes.AttributeBasedTypeDefinition(typeof(DecoratedTimeSeries));
     var table = GetTable<DecoratedTimeSeries>(sessionMock.Object, definition);
     table.Create();
     //It contains Ignored props: Ignored1 and Ignored2
     Assert.AreEqual(@"CREATE TABLE ""ks1"".""tbl1"" (""name"" text, ""Slice"" int, ""Time"" timeuuid, ""val"" double, ""Value2"" text, PRIMARY KEY ((""name"", ""Slice""), ""Time""))", createQuery);
 }