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); }
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); }
public static bool AssertListContains(List <AllDataTypesEntity> expectedEntities, AllDataTypesEntity actualEntity) { foreach (var expectedEntity in expectedEntities) { try { AssertEquals(expectedEntity, actualEntity); return(true); } catch (AssertionException) { } } return(false); }
public void AssertEquals(AllDataTypesEntity actualEntity) { AllDataTypesEntityUtil.AssertEquals(this, actualEntity); }
public static AllDataTypesEntity GetRandomInstance() { AllDataTypesEntity adte = new AllDataTypesEntity(); return((AllDataTypesEntity)AllDataTypesEntityUtil.Randomize(adte)); }