Example #1
0
        public void AddNewItemToStoreable()
        {
            IStoreable addStorable = new Storable();

            addStorable.Id = 1;
            RepositoryImplementation <IStoreable> ri = new RepositoryImplementation <IStoreable>();

            ri.Save(addStorable);
            Assert.IsTrue(1 == (int)addStorable.Id);
            IStoreable retStorable = ri.FindById(addStorable.Id);

            Assert.IsTrue(retStorable.Id == addStorable.Id);
        }
Example #2
0
        public void GetStorableItemByInvalidId()
        {
            IStoreable addStorable = new Storable();

            addStorable.Id = 1;
            RepositoryImplementation <IStoreable> ri = new RepositoryImplementation <IStoreable>();

            ri.Save(addStorable);
            addStorable.Id = 2;
            ri.Save(addStorable);
            addStorable.Id = 3;
            ri.Save(addStorable);

            IStoreable retVal = ri.FindById(4);

            Assert.IsTrue((int)retVal.Id == 4);
        }