チェンジセット 1596 (default)


以下の違いを無視:
日時:
2023/08/20 4:22:02 (14ヵ月前)
更新者:
hizuya@…
ログメッセージ:
  • NUnit 用の Json データを検査する機能を追加。
場所:
framework/trunk
ファイル:
3個の追加
4個の更新

凡例:

未変更
追加
削除
  • framework/trunk/CoreLibrary/Sources/Json/JsonBeanInfoManager.cs

    r900 r1596  
    4040                delegate(Type type) 
    4141                { 
    42                     return new JsonBeanInfo(type); 
     42                    return Attribute.IsDefined(type, typeof(JsonBeanAttribute)) 
     43                        ? new JsonBeanInfo(type) 
     44                        : null; 
    4345                }); 
    4446 
     
    5254        /// <returns> 
    5355        /// <see cref="JsonBeanInfo"/> オブジェクト。 
     56        /// JSON ビーンではない場合は <see langword="null"/>。 
    5457        /// </returns> 
    5558        /// <exception cref="ArgumentNullException"> 
     
    7578        /// <returns> 
    7679        /// <see cref="JsonBeanInfo"/> オブジェクト。 
     80        /// JSON ビーンではない場合は <see langword="null"/>。 
    7781        /// </returns> 
    7882        /// <exception cref="ArgumentNullException"> 
  • framework/trunk/CoreLibrary/Sources/Json/JsonOperator.cs

    r1547 r1596  
    10861086            { 
    10871087                bean = creator.CreateObject(parentBean); 
    1088                 jsonBeanInfo = bean != null ? GetJsonBeanInfo(bean) : null; 
     1088                jsonBeanInfo = bean != null ? JsonBeanInfoManager.Get(bean) : null; 
    10891089            } 
    10901090            else 
     
    12721272 
    12731273        /// <summary> 
    1274         /// 指定したインスタンスに対応する <see cref="JsonBeanInfo"/> を取得します。 
    1275         /// </summary> 
    1276         /// <param name="bean"> 
    1277         /// 対象のインスタンス。 
    1278         /// </param> 
    1279         /// <returns> 
    1280         /// 対応する <see cref="JsonBeanInfo"/>。 
    1281         /// JSON ビーンではない場合は <see langword="null"/> 参照です。 
    1282         /// </returns> 
    1283         private static JsonBeanInfo GetJsonBeanInfo(object bean) 
    1284         { 
    1285             Type beanType = bean.GetType(); 
    1286             return Attribute.IsDefined(beanType, typeof(JsonBeanAttribute)) 
    1287                 ? JsonBeanInfoManager.Get(beanType) 
    1288                 : null; 
    1289         } 
    1290  
    1291         /// <summary> 
    12921274        /// メンバに対応する <see cref="IJsonMemberAccessor"/> を取得します。 
    12931275        /// </summary> 
     
    14051387            { 
    14061388                // JSON ビーンの場合 
    1407                 Type type = source.GetType(); 
    1408                 if (Attribute.IsDefined(type, typeof(JsonBeanAttribute))) 
    1409                 { 
    1410                     JsonBeanInfoManager.Get(type).Save(writer, source); 
     1389                JsonBeanInfo jsonBeanInfo = JsonBeanInfoManager.Get(source); 
     1390                if (jsonBeanInfo != null) 
     1391                { 
     1392                    jsonBeanInfo.Save(writer, source); 
    14111393                    return; 
    14121394                } 
  • framework/trunk/TestLibrary/TestLibrary.csproj

    r1581 r1596  
    6969    <Compile Include="Sources\GeneralWebServer.cs" /> 
    7070    <Compile Include="Sources\InMemoryWebServer.cs" /> 
     71    <Compile Include="Sources\JsonExpectedData.cs" /> 
     72    <Compile Include="Sources\JsonNUnitExtensions.cs" /> 
    7173    <Compile Include="Sources\NativeMethods.cs" /> 
    7274    <Compile Include="Sources\NUnitTraceListener.cs" /> 
  • framework/trunk/TestTest/TestTest.csproj

    r1576 r1596  
    5151    <Compile Include="Sources\CascadingTraceListenerTest.cs" /> 
    5252    <Compile Include="Sources\InMemoryWebServerTest.cs" /> 
     53    <Compile Include="Sources\JsonNUnitExtensionsTest.cs" /> 
    5354    <Compile Include="Sources\RedirectTraceListenerTest.cs" /> 
    5455    <Compile Include="Sources\TestTestBase.cs" /> 
詳しい使い方は TracChangeset を参照してください。