Ejemplo n.º 1
0
        public void ShouldGetColumnFromCollection()
        {
            var columns = new ColumnEntityCollection();
            var column  = DatabaseEntityFactory.CreateColumnEntity("CustomerId", new ColumnDataTypeDefinition("int", false), true, 1, false, null, null);

            columns.Add(column);

            Assert.That(columns[0], Is.EqualTo(column));
            Assert.That(columns.Get("CustomerId"), Is.EqualTo(column));
        }
Ejemplo n.º 2
0
        public void ShouldGetExceptionWhenTryingToGetColumnThatDoesNotExist()
        {
            bool exceptionHappened = false;
            var  columns           = new ColumnEntityCollection();

            try
            {
                Assert.That(columns[0], Is.Null);
                Assert.That(columns.Get("CustomerId"), Is.Null);
            }
            catch (KeyNotFoundException)
            {
                exceptionHappened = true;
            }
            Assert.That(exceptionHappened);
        }