public void Add_Existing_Fails()
        {
            MockTable <TestEntity> database = new MockTable <TestEntity>();

            database.Add(new TestEntity(1234));
            database.Add(new TestEntity(1234));     // throws exception
        }
        public void Find_Entity_Success()
        {
            MockTable<TestEntity> database = new MockTable<TestEntity>();
            database.Add(new TestEntity(1234));
            Assert.AreEqual<string>("1234", database.Get(1234).ToString());

            database.Add(new TestEntity(5678));
            Assert.AreEqual<string>("5678", database.Get(5678).ToString());
            Assert.AreEqual<string>("1234", database.Get(1234).ToString()); // Still
        }
        public void Find_Entity_Success()
        {
            MockTable <TestEntity> database = new MockTable <TestEntity>();

            database.Add(new TestEntity(1234));
            Assert.AreEqual <string>("1234", database.Get(1234).ToString());

            database.Add(new TestEntity(5678));
            Assert.AreEqual <string>("5678", database.Get(5678).ToString());
            Assert.AreEqual <string>("1234", database.Get(1234).ToString()); // Still
        }
        public void Add_Success()
        {
            MockTable<TestEntity> database = new MockTable<TestEntity>();
            Assert.AreEqual<int>(0, database.Size);

            database.Add(new TestEntity(1234));
            Assert.AreEqual<int>(1, database.Size);

            database.Add(new TestEntity(5678));
            Assert.AreEqual<int>(2, database.Size);
        }
        public void Add_Success()
        {
            MockTable <TestEntity> database = new MockTable <TestEntity>();

            Assert.AreEqual <int>(0, database.Size);

            database.Add(new TestEntity(1234));
            Assert.AreEqual <int>(1, database.Size);

            database.Add(new TestEntity(5678));
            Assert.AreEqual <int>(2, database.Size);
        }
        public void Exists_Failure()
        {
            MockTable <TestEntity> database = new MockTable <TestEntity>();

            database.Add(new TestEntity(1234));
            Assert.IsFalse(database.Exists(5678));
        }
        public void Exists_Success()
        {
            MockTable <TestEntity> database = new MockTable <TestEntity>();

            database.Add(new TestEntity(1234));
            Assert.IsTrue(database.Exists(1234));
        }
        public void Find_Nonexistent_ReturnsNull()
        {
            MockTable <TestEntity> database = new MockTable <TestEntity>();

            database.Add(new TestEntity(1234));
            Assert.IsNull(database.Get(5678));
        }
        public void Select_TestEntity_To_Int()
        {
            TestEntities = new MockTable <TestEntity>();
            TestEntities.Add(new TestEntity(42), new TestEntity(43), new TestEntity(44),
                             new TestEntity(99), new TestEntity(0));

            IEnumerable <int> returns = TestEntities.Select(item => item.EntityId);
        }
 public void TestInitialize()
 {
     TestEntities = new MockTable <TestEntity>();
     TestEntities.Add(new TestEntity(42), new TestEntity(43), new TestEntity(44),
                      new TestEntity(99), new TestEntity(0));
 }
 public void Find_Nonexistent_ReturnsNull()
 {
     MockTable<TestEntity> database = new MockTable<TestEntity>();
     database.Add(new TestEntity(1234));
     Assert.IsNull(database.Get(5678));
 }
 public void Exists_Success()
 {
     MockTable<TestEntity> database = new MockTable<TestEntity>();
     database.Add(new TestEntity(1234));
     Assert.IsTrue(database.Exists(1234));
 }
 public void Exists_Failure()
 {
     MockTable<TestEntity> database = new MockTable<TestEntity>();
     database.Add(new TestEntity(1234));
     Assert.IsFalse(database.Exists(5678));
 }
 public void Add_Existing_Fails()
 {
     MockTable<TestEntity> database = new MockTable<TestEntity>();
     database.Add(new TestEntity(1234));
     database.Add(new TestEntity(1234));     // throws exception
 }
 public void TestInitialize()
 {
     TestEntities = new MockTable<TestEntity>();
     TestEntities.Add(new TestEntity(42), new TestEntity(43), new TestEntity(44),
         new TestEntity(99), new TestEntity(0));
 }
        public void Select_TestEntity_To_Int()
        {
            TestEntities = new MockTable<TestEntity>();
            TestEntities.Add(new TestEntity(42), new TestEntity(43), new TestEntity(44),
                new TestEntity(99), new TestEntity(0) );

            IEnumerable<int> returns = TestEntities.Select(item => item.EntityId);
        }