public static EntityWithDictionaryType GetRandomInstance(int seed = 1)
 {
     EntityWithDictionaryType entity = new EntityWithDictionaryType();
     entity.Id = Guid.NewGuid().ToString();
     entity.DictionaryType = new Dictionary<string, string>() { {"key_" + seed, "val_" + seed} };
     return entity;
 }
 public EntityWithDictionaryType Clone()
 {
     EntityWithDictionaryType entity = new EntityWithDictionaryType();
     entity.Id = Id;
     entity.DictionaryType = new Dictionary<string, string>(DictionaryType);
     return entity;
 }
        public EntityWithDictionaryType Clone()
        {
            EntityWithDictionaryType entity = new EntityWithDictionaryType();

            entity.Id             = Id;
            entity.DictionaryType = new Dictionary <string, string>(DictionaryType);
            return(entity);
        }
        public EntityWithDictionaryType Clone()
        {
            var entity = new EntityWithDictionaryType
            {
                Id             = Id,
                DictionaryType = new Dictionary <string, string>(DictionaryType)
            };

            return(entity);
        }
        public static List <EntityWithDictionaryType> GetDefaultEntityList()
        {
            var entityList = new List <EntityWithDictionaryType>();

            for (var i = 0; i < EntityWithDictionaryType.DefaultListLength; i++)
            {
                entityList.Add(EntityWithDictionaryType.GetRandomInstance(i));
            }
            return(entityList);
        }
        public static EntityWithDictionaryType GetRandomInstance(int seed = 1)
        {
            EntityWithDictionaryType entity = new EntityWithDictionaryType();

            entity.Id             = Guid.NewGuid().ToString();
            entity.DictionaryType = new Dictionary <string, string>()
            {
                { "key_" + seed, "val_" + seed }
            };
            return(entity);
        }
        public static Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> > GetDefaultTable(
            ISession session, string tableName)
        {
            // create table
            var config = new MappingConfiguration().Define(
                new Map <EntityWithDictionaryType>()
                .TableName(tableName)
                .PartitionKey(u => u.Id));
            var table = new Table <EntityWithDictionaryType>(session, config);

            var entityList = EntityWithDictionaryType.GetDefaultEntityList();

            return(new Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> >(table, entityList));
        }
        public static Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> > SetupDefaultTable(ISession session)
        {
            // create table
            var config = new MappingConfiguration().Define(
                new Map <EntityWithDictionaryType>()
                .TableName($"EntityWithDictionaryType_{Randomm.RandomAlphaNum(12)}")
                .PartitionKey(u => u.Id));
            var table = new Table <EntityWithDictionaryType>(session, config);

            table.Create();

            var entityList = EntityWithDictionaryType.GetDefaultEntityList();

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

            return(new Tuple <Table <EntityWithDictionaryType>, List <EntityWithDictionaryType> >(table, entityList));
        }
 public void AssertEquals(EntityWithDictionaryType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(DictionaryType, actualEntity.DictionaryType);
 }
 public void AssertEquals(EntityWithDictionaryType actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(DictionaryType, actualEntity.DictionaryType);
 }