Пример #1
0
            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");
            }
Пример #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");
            }
Пример #3
0
            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");
            }
Пример #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");
            }
Пример #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");
            }
Пример #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");
            }
Пример #7
0
 public void ShouldThrowArgumentNullExceptionWhenRowTypeIsNull()
 {
     GWT.Given("testing static method")
     .When(x => TableMetaData.GetTable(rowType: null))
     .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("rowType");
 }
Пример #8
0
 public void ShouldThrowArgumentNullExceptionWhenRowTypeIsNull()
 {
     GWT.Given("testing constructor")
     .When(x => new TableMetaData(rowType: null))
     .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("rowType");
 }