public static EntityWithArrayType GetRandomInstance(int seed = 1)
 {
     EntityWithArrayType entity = new EntityWithArrayType();
     entity.Id = Guid.NewGuid().ToString();
     entity.ArrayType = new string[] { seed.ToString() };
     return entity;
 }
Beispiel #2
0
        public static EntityWithArrayType GetRandomInstance(int seed = 1)
        {
            var entity = new EntityWithArrayType();

            entity.Id        = Guid.NewGuid().ToString();
            entity.ArrayType = new string[] { seed.ToString() };
            return(entity);
        }
 public EntityWithArrayType Clone()
 {
     EntityWithArrayType entity = new EntityWithArrayType();
     entity.Id = Id;
     List<string> strList = new List<string>();
     strList.AddRange(ArrayType);
     entity.ArrayType = strList.ToArray();
     return entity;
 }
Beispiel #4
0
        public static List <EntityWithArrayType> GetDefaultEntityList()
        {
            var entityList = new List <EntityWithArrayType>();

            for (var i = 0; i < EntityWithArrayType.DefaultListLength; i++)
            {
                entityList.Add(EntityWithArrayType.GetRandomInstance(i));
            }
            return(entityList);
        }
Beispiel #5
0
        public EntityWithArrayType Clone()
        {
            var entity = new EntityWithArrayType();

            entity.Id = Id;
            var strList = new List <string>();

            strList.AddRange(ArrayType);
            entity.ArrayType = strList.ToArray();
            return(entity);
        }
Beispiel #6
0
        public static Tuple <Table <EntityWithArrayType>, List <EntityWithArrayType> > GetDefaultTable(
            ISession session, string tableName)
        {
            // create table
            var config = new MappingConfiguration().Define(
                new Map <EntityWithArrayType>()
                .TableName(tableName)
                .PartitionKey(u => u.Id));
            var table      = new Table <EntityWithArrayType>(session, config);
            var entityList = EntityWithArrayType.GetDefaultEntityList();

            return(new Tuple <Table <EntityWithArrayType>, List <EntityWithArrayType> >(table, entityList));
        }
Beispiel #7
0
        public static Tuple <Table <EntityWithArrayType>, List <EntityWithArrayType> > SetupDefaultTable(ISession session)
        {
            // create table
            var config = new MappingConfiguration().Define(
                new Map <EntityWithArrayType>()
                .TableName("EntityWithArrayType_" + Randomm.RandomAlphaNum(12))
                .PartitionKey(u => u.Id));
            var table = new Table <EntityWithArrayType>(session, config);

            table.Create();

            var entityList = EntityWithArrayType.GetDefaultEntityList();

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

            return(new Tuple <Table <EntityWithArrayType>, List <EntityWithArrayType> >(table, entityList));
        }
Beispiel #8
0
 public void AssertEquals(EntityWithArrayType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(ArrayType, actualEntity.ArrayType);
 }
 public void AssertEquals(EntityWithArrayType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(ArrayType, actualEntity.ArrayType);
 }