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)); }
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); }