public void ShouldThrowArgumentNullExceptionWhenPropertyIsNull()
            {
                var table = new TableMetaData <TestEntity>();

                GWT.Given("constructor test")
                .When(x => new ColumnMetaData(table: table, property: null))
                .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("property");
            }
Example #2
0
            public void ShouldThrowArgumentNullExceptionWhenLanguageIsNull()
            {
                var connection = new FakeDbConnection();

                GWT.Given("testing constructor")
                .When(x => new Database <IDbConnection, IDbLanguage>(connection: connection, language: null))
                .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("language");
            }
            public void ShouldThrowArgumentNullExceptionWhenRowIsNull()
            {
                var mockProperty = (new Mock <PropertyInfo>()).Object;

                GWT.Given("constructor test")
                .When(x => new ColumnMetaData(table: null, property: mockProperty))
                .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("table");
            }
Example #4
0
            public void ShouldThrowArgumentNullExceptionWhenTableIsNull()
            {
                var           connection = new FakeDbConnection(openConnection: true);
                var           language   = new FakeDbLanguage();
                TableMetaData nullTable  = null;

                GWT.Given(new Database <IDbConnection, IDbLanguage>(connection, language))
                .When(d => d.CreateTable(nullTable))
                .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("table");
            }
Example #5
0
            public void ShouldThrowArgumentNullExceptionWhenTableIsNull()
            {
                var connection = new FakeDbConnection(openConnection: true);
                var language   = new FakeDbLanguage();
                var row        = new TestEntity();

                GWT.Given(new Database <IDbConnection, IDbLanguage>(connection, language))
                .When(d => d.Insert(row: row, table: null))
                .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("table");
            }
Example #6
0
            public void ShouldThrowArgumentNullExceptionWhenRowIsNull()
            {
                var        connection = new FakeDbConnection(openConnection: true);
                var        language   = new FakeDbLanguage();
                var        table      = new TableMetaData <TestEntity>();
                TestEntity nullRow    = null;

                GWT.Given(new Database <IDbConnection, IDbLanguage>(connection, language))
                .When(d => d.Insert(row: nullRow))
                .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("row");
            }
Example #7
0
 public void ShouldThrowArgumentNullExceptionWhenRowTypeIsNull()
 {
     GWT.Given("testing static method")
     .When(x => TableMetaData.GetTable(rowType: null))
     .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("rowType");
 }
Example #8
0
 public void ShouldThrowArgumentNullExceptionWhenRowTypeIsNull()
 {
     GWT.Given("testing constructor")
     .When(x => new TableMetaData(rowType: null))
     .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("rowType");
 }