コード例 #1
0
        private static AllDataTypesEntity WriteReadValidateUsingSessionBatch(Table <AllDataTypesEntity> table)
        {
            Batch batch = table.GetSession().CreateBatch();
            AllDataTypesEntity expectedDataTypesEntityRow = AllDataTypesEntity.GetRandomInstance();
            string             uniqueKey = expectedDataTypesEntityRow.StringType;

            batch.Append(table.Insert(expectedDataTypesEntityRow));
            batch.Execute();

            List <AllDataTypesEntity> listOfAllDataTypesObjects = (from x in table where x.StringType.Equals(uniqueKey) select x).Execute().ToList();

            Assert.NotNull(listOfAllDataTypesObjects);
            Assert.AreEqual(1, listOfAllDataTypesObjects.Count);
            AllDataTypesEntity actualDataTypesEntityRow = listOfAllDataTypesObjects.First();

            expectedDataTypesEntityRow.AssertEquals(actualDataTypesEntityRow);
            return(expectedDataTypesEntityRow);
        }
コード例 #2
0
        private static AllDataTypesEntity WriteReadValidateUsingTableMethods(Table <AllDataTypesEntity> table)
        {
            AllDataTypesEntity expectedDataTypesEntityRow = AllDataTypesEntity.GetRandomInstance();
            string             uniqueKey = expectedDataTypesEntityRow.StringType;

            // insert record
            table.GetSession().Execute(table.Insert(expectedDataTypesEntityRow));

            // select record
            List <AllDataTypesEntity> listOfAllDataTypesObjects = (from x in table where x.StringType.Equals(uniqueKey) select x).Execute().ToList();

            Assert.NotNull(listOfAllDataTypesObjects);
            Assert.AreEqual(1, listOfAllDataTypesObjects.Count);
            AllDataTypesEntity actualDataTypesEntityRow = listOfAllDataTypesObjects.First();

            expectedDataTypesEntityRow.AssertEquals(actualDataTypesEntityRow);
            return(expectedDataTypesEntityRow);
        }
コード例 #3
0
 public static bool AssertListContains(List <AllDataTypesEntity> expectedEntities, AllDataTypesEntity actualEntity)
 {
     foreach (var expectedEntity in expectedEntities)
     {
         try
         {
             AssertEquals(expectedEntity, actualEntity);
             return(true);
         }
         catch (AssertionException) { }
     }
     return(false);
 }
コード例 #4
0
 public void AssertEquals(AllDataTypesEntity actualEntity)
 {
     AllDataTypesEntityUtil.AssertEquals(this, actualEntity);
 }
コード例 #5
0
        public static AllDataTypesEntity GetRandomInstance()
        {
            AllDataTypesEntity adte = new AllDataTypesEntity();

            return((AllDataTypesEntity)AllDataTypesEntityUtil.Randomize(adte));
        }