public void コンストラクタ_exception_message_args_で設定したメッセージがnullのときMessageプロパティはデフォルトメッセージを返す() { // when ConfigException exception = new ConfigException(new Exception(), null); // then Assert.IsNotNull(exception.Message); }
private void コンストラクタ_message_args_で設定したリソースキーはMessageプロパティでメッセージ変換される(String key, String result) { try { // when setup(); Resi.Add(new ResourceManager("XPFriend.JunkTest.testres.Resources_test01", typeof(ResiTest).Assembly)); ConfigException exception = new ConfigException(key); // then Assert.AreEqual(result, exception.Message); Assert.AreEqual(key, exception.ResourceKey); } finally { cleanup(); } }
private void コンストラクタ_message_args_で設定したメッセージ引数を使ってMessageプロパティはメッセージ変換する(String args, String result) { // when ConfigException exception = new ConfigException("ddd", args); // then Assert.AreEqual(result, exception.Message); }
private void コンストラクタ_message_args_で設定したメッセージはMessageプロパティで取得できる(String message) { // when ConfigException exception = new ConfigException(message); // then Assert.AreEqual(message, exception.Message); Assert.AreEqual(message, exception.ResourceKey); }
private void コンストラクタ_exceptionで設定した例外はInnerExceptionプロパティで取得できる(Exception cause) { // when ConfigException exception = new ConfigException(cause); // then Assert.AreSame(cause, exception.InnerException); }
private void Cultureプロパティに設定した値はCultureプロパティで取得できる(CultureInfo culture) { // setup ConfigException exception = new ConfigException(""); // when exception.Culture = culture; // then Assert.AreEqual(culture, exception.Culture); }
private void Cultureプロパティで設定されたカルチャでMessageプロパティはメッセージ変換する(CultureInfo culture, string result) { // when ConfigException exception = new ConfigException("aaa"); exception.Culture = culture; // then Assert.AreEqual(result, exception.Message); }