Example #1
0
        public void CachModul()
        {
            FaceRepository repository = new FaceRepository();
            СacheModul     сacheModul = new СacheModul(repository);

            for (int i = 0; i < 5; i++)
            {
                IComondModul <IMyEntity> comondGet = сacheModul.Сommand(comondModul.GetComond(typeof(IUser), TypeComond.Get, null));
            }
            if (repository.amount(TypeComond.Get) != 1)
            {
                throw new Exception("CachModul отпровляет много запросов get вместо одного");
            }
        }
Example #2
0
        public void CreatСacheModul()
        {
            FaceRepository repository = new FaceRepository();
            СacheModul     сacheModul = new СacheModul(repository);



            for (int i = 0; i < 5; i++)
            {
                IComondModul <IMyEntity> comondGet = сacheModul.Сommand(comondModul.GetComond(typeof(IUser), TypeComond.Get, null));
            }


            Assert.AreEqual(1, repository.amount(TypeComond.Get));
        }