Пример #1
0
 public static EntityWithListType GetRandomInstance(int seed = 1)
 {
     EntityWithListType entity = new EntityWithListType();
     entity.Id = Guid.NewGuid().ToString();
     entity.ListType = new List<int>() { seed };
     return entity;
 }
Пример #2
0
 public EntityWithListType Clone()
 {
     EntityWithListType entity = new EntityWithListType();
     entity.Id = Id;
     entity.ListType = new List<int>();
     entity.ListType.AddRange(ListType);
     return entity;
 }
Пример #3
0
        public static Tuple <Table <EntityWithListType>, List <EntityWithListType> > SetupDefaultTable(
            ISession session)
        {
            // create table
            var config = new MappingConfiguration().Define(
                new Map <EntityWithListType>()
                .TableName("EntityWithListType_" + Randomm.RandomAlphaNum(12))
                .PartitionKey(u => u.Id));
            var table = new Table <EntityWithListType>(session, config);

            table.Create();

            var entityList = EntityWithListType.GetDefaultEntityList();

            //Insert some data
            foreach (var singleEntity in entityList)
            {
                table.Insert(singleEntity).Execute();
            }

            return(new Tuple <Table <EntityWithListType>, List <EntityWithListType> >(table, entityList));
        }
Пример #4
0
 public void AssertEquals(EntityWithListType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     CollectionAssert.AreEquivalent(ListType, actualEntity.ListType);
 }
Пример #5
0
 public void AssertEquals(EntityWithListType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(ListType, actualEntity.ListType);
 }
Пример #6
0
 public void AssertEquals(EntityWithListType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     CollectionAssert.AreEquivalent(ListType, actualEntity.ListType);
 }