Beispiel #1
0
        public void HttpStatusCodeIsPopulated()
        {
            var ex = new TableNotFoundException("db", "sch", "tbl");

            Assert.AreEqual(HttpStatusCode.InternalServerError, ex.ResponseCode);
        }
Beispiel #2
0
        public void HttpErrorMessageIsPopulated()
        {
            var ex = new TableNotFoundException("db", "sch", "tbl");

            Assert.AreEqual("TableNotFound", ex.HttpErrorMessage);
        }
Beispiel #3
0
        public void IsBaseException()
        {
            var ex = new TableNotFoundException("db", "a", "b");

            Assert.IsInstanceOfType(ex, typeof(BaseCaughtException));
        }
Beispiel #4
0
        public void ErrorMessageIsPopulated()
        {
            var ex = new TableNotFoundException("db", "sch", "tbl");

            Assert.AreEqual("Table 'db.sch.tbl' not found.", ex.Message);
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MissingTableError"/> class.
 /// </summary>
 /// <param name="table">The missing table that is defined in the DbContext model.</param>
 /// <param name="exception">The exception that occured when trying to get the table.</param>
 public MissingTableError(Table table, TableNotFoundException exception) : base(table)
 {
     MissingTableException = exception;
 }