예제 #1
0
 public static EntityWithArrayType GetRandomInstance(int seed = 1)
 {
     EntityWithArrayType entity = new EntityWithArrayType();
     entity.Id = Guid.NewGuid().ToString();
     entity.ArrayType = new string[] { seed.ToString() };
     return entity;
 }
예제 #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);
        }
예제 #3
0
 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;
 }
예제 #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);
        }
예제 #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);
        }
예제 #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));
        }
예제 #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));
        }
예제 #8
0
 public void AssertEquals(EntityWithArrayType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(ArrayType, actualEntity.ArrayType);
 }
예제 #9
0
 public void AssertEquals(EntityWithArrayType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(ArrayType, actualEntity.ArrayType);
 }