コード例 #1
0
 public void AssertEquals(EntityWithAllCollectionTypes actualEntity)
 {
     Assert.AreEqual(Id, actualEntity.Id);
     Assert.AreEqual(ListType, actualEntity.ListType);
     Assert.AreEqual(ArrayType, actualEntity.ArrayType);
     Assert.AreEqual(DictionaryType, actualEntity.DictionaryType);
 }
コード例 #2
0
        public EntityWithAllCollectionTypes Clone()
        {
            EntityWithAllCollectionTypes cte = new EntityWithAllCollectionTypes();

            cte.Id       = Id;
            cte.ListType = new List <int>();
            cte.ListType.AddRange(ListType);
            cte.ArrayType      = (string[])ArrayType.Clone();
            cte.DictionaryType = new Dictionary <string, string>();
            foreach (var fav in DictionaryType)
            {
                cte.DictionaryType.Add(fav.Key, fav.Value);
            }
            return(cte);
        }
コード例 #3
0
        public static EntityWithAllCollectionTypes GetRandomInstance(int seed = 1)
        {
            EntityWithAllCollectionTypes cte = new EntityWithAllCollectionTypes();

            cte.Id       = Guid.NewGuid().ToString();
            cte.ListType = new List <int>()
            {
                seed
            };
            cte.ArrayType      = new string[] { seed.ToString() };
            cte.DictionaryType = new Dictionary <string, string>()
            {
                { "key_" + seed, "val_" + seed }
            };
            return(cte);
        }