Exemplo n.º 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");
            }
Exemplo n.º 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");
            }
Exemplo n.º 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");
            }
Exemplo n.º 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");
            }
Exemplo n.º 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");
            }
Exemplo n.º 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");
            }
Exemplo n.º 7
0
 public void ShouldThrowArgumentNullExceptionWhenRowTypeIsNull()
 {
     GWT.Given("testing static method")
     .When(x => TableMetaData.GetTable(rowType: null))
     .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("rowType");
 }
Exemplo n.º 8
0
 public void ShouldThrowArgumentNullExceptionWhenRowTypeIsNull()
 {
     GWT.Given("testing constructor")
     .When(x => new TableMetaData(rowType: null))
     .Then <ArgumentNullException>().ShouldBeThrown().ForParameter("rowType");
 }