1 /** 2 Copyright: 2017 © LLC CERERIS 3 License: MIT 4 Authors: LLC CERERIS 5 */ 6 7 module checkit.exception; 8 9 /// Exception fot unit tests 10 class UnitTestException: Exception 11 { 12 public: 13 /** Constructor with string 14 15 Params: 16 message = Exception message. 17 file = The file name that the assert failed in. Should be left as default. 18 line = The file line that the assert failed in. Should be left as default. 19 next = Next Throwable object. 20 */ 21 this(in string message, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure nothrow 22 { 23 this([message], file, line, next); 24 } 25 26 /** Constructor with list strings 27 28 Params: 29 messageLines = Exception message list. 30 file = The file name that the assert failed in. Should be left as default. 31 line = The file line that the assert failed in. Should be left as default. 32 next = Next Throwable object. Should be left as default. 33 */ 34 this(in string[] messageLines, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure nothrow 35 { 36 import std..string: join; 37 super(messageLines.join("\n"), next, file, line); 38 _messageLines = messageLines; 39 } 40 41 private: 42 const string[] _messageLines; 43 }