예제 #1
0
        public void コンストラクタ_exception_message_args_で設定したメッセージがnullのときMessageプロパティはデフォルトメッセージを返す()
        {
            // when
            ConfigException exception = new ConfigException(new Exception(), null);

            // then
            Assert.IsNotNull(exception.Message);
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        private void コンストラクタ_message_args_で設定したメッセージ引数を使ってMessageプロパティはメッセージ変換する(String args, String result)
        {
            // when
            ConfigException exception = new ConfigException("ddd", args);

            // then
            Assert.AreEqual(result, exception.Message);
        }
예제 #4
0
        private void コンストラクタ_message_args_で設定したメッセージはMessageプロパティで取得できる(String message)
        {
            // when
            ConfigException exception = new ConfigException(message);

            // then
            Assert.AreEqual(message, exception.Message);
            Assert.AreEqual(message, exception.ResourceKey);
        }
예제 #5
0
        private void コンストラクタ_exceptionで設定した例外はInnerExceptionプロパティで取得できる(Exception cause)
        {
            // when
            ConfigException exception = new ConfigException(cause);

            // then
            Assert.AreSame(cause, exception.InnerException);
        }
예제 #6
0
        private void Cultureプロパティに設定した値はCultureプロパティで取得できる(CultureInfo culture)
        {
            // setup
            ConfigException exception = new ConfigException("");

            // when
            exception.Culture = culture;

            // then
            Assert.AreEqual(culture, exception.Culture);
        }
예제 #7
0
        private void Cultureプロパティで設定されたカルチャでMessageプロパティはメッセージ変換する(CultureInfo culture, string result)
        {
            // when
            ConfigException exception = new ConfigException("aaa");
            exception.Culture = culture;

            // then
            Assert.AreEqual(result, exception.Message);
        }