1

R# で単体テストを実行すると以下のエラーが発生しますが、テストは Visual Studio MSTest で期待どおりに合格します。これは、エンティティ フレームワークに触れるすべてのもので発生し、他のテストは問題なく動作します。これは、 dll はデプロイされませんでしたが、すべての dll が deploy local = true としてマークされていることを確認しました。また、これが R# で問題を引き起こす可能性があることを読んだときにプロファイリングがオフになっていることを確認しました。例外はかなり奇妙で、実際には見つかりませんなぜこれが起こるのかについての韻や理由。コードも問題なく実行されるため、R# またはその構成に何か問題があることがわかります。残念ながら、R# の MSTest 画面ですべてを試しましたが、「MSTests.exe でテストを実行する (非推奨)」を使用しても、すべてのテストが失敗します。ただし、エンティティ フレームワークを扱う場合のみです。そうでなければ、問題なく動作します。これは他の同僚のシステムでも発生しているため、私のシステムだけではありません。

テスト メソッド Calamos.Ccs.Research.Repository.Test.DatabaseContext.EntityFrameworkContexts.ResearchContext

Test.TestFactorPeriod が例外をスローしました: System.InvalidOperationException: タイプ 'Calamos.Ccs.Research.Business.Oltp.Geographic.Exchange' のプロパティ 'CountryId' の ForeignKeyAttribute が無効です。依存タイプ「Calamos.Ccs.Research.Business.Oltp.Geographic.Exchange」でナビゲーション プロパティ「Country」が見つかりませんでした。Name 値は、有効なナビゲーション プロパティ名である必要があります。System.Data.Entity.ModelConfiguration.Conventions.ForeignKeyPrimitivePropertyAttributeConvention.ForeignKeyAttributeConventionImpl.ApplyNavigationProperty (PropertyInfo propertyInfo、ModelConfiguration modelConfiguration、ForeignKeyAttribute foreignKeyAttribute) で System.Data.Entity.ModelConfiguration.Conventions.ForeignKeyPrimitivePropertyAttributeConvention.ForeignKeyAttributeConventionImpl.Apply (PropertyInfo propertyInfo、3.System.Data.Entity.ModelConfiguration.Conventions.IConfigurationConvention<TMemberInfo,TConfiguration>.Apply(TMemberInfo memberInfo, Func1 構成) System.Data.Entity.ModelConfiguration.Conventions.ForeignKeyPrimitivePropertyAttributeConvention.System.Data.Entity.ModelConfiguration.Conventions.IConfigurationConvention.Apply (PropertyInfo memberInfo、Func 1 configuration) at System.Data.Entity.ModelConfiguration.Configuration.ConventionsConfiguration.ApplyPropertyConfiguration(PropertyInfo propertyInfo, ModelConfiguration modelConfiguration) at System.Data.Entity.ModelConfiguration.Mappers.TypeMapper.MapStructuralElements(Type type, ICollection1 注釈、Action 2 propertyMappingAction, Boolean mapDeclaredPropertiesOnly, Func1 structureTypeConfiguration) で System.Data.Entity.ModelConfiguration で。 System.Data.Entity.ModelConfiguration.Mappers.NavigationPropertyMapper.Map(PropertyInfo propertyInfo、EdmEntityType entityType、Func 1 entityTypeConfiguration, Type sourceType) at System.Data.Entity.ModelConfiguration.Mappers.PropertyMapper.Map(PropertyInfo propertyInfo, EdmEntityType entityType, Func1 entityTypeConfiguration、Type sourceType) の Mappers.TypeMapper.MapEntityType(Type タイプ) System.Data.Entity.ModelConfiguration.Mappers.TypeMapper. <>c_ DisplayClass12.b _e(PropertyMapper m, PropertyInfo p) System.Data.Entity.ModelConfiguration.Mappers.TypeMapper.MapStructuralElements(Type タイプ, ICollection)1 annotations, Action2 propertyMappingAction、Boolean mapDeclaredPropertiesOnly、Func 1 structuralTypeConfiguration) at System.Data.Entity.ModelConfiguration.Mappers.TypeMapper.MapEntityType(Type type) at System.Data.Entity.ModelConfiguration.Mappers.NavigationPropertyMapper.Map(PropertyInfo propertyInfo, EdmEntityType entityType, Func1 entityTypeConfiguration、Type sourceType) System.Data.Entity.ModelConfiguration.Mappers.PropertyMapper.Map(PropertyInfo propertyInfo、EdmEntityType entityType、Func 1 entityTypeConfiguration, Type sourceType) at System.Data.Entity.ModelConfiguration.Mappers.TypeMapper.<>c__DisplayClass12.<MapEntityType>b__e(PropertyMapper m, PropertyInfo p) at System.Data.Entity.ModelConfiguration.Mappers.TypeMapper.MapStructuralElements(Type type, ICollection1 注釈、Action 1structureTypeConfiguration 2 propertyMappingAction, Boolean mapDeclaredPropertiesOnly, Func) System.Data.Entity.ModelConfiguration で.Mappers.TypeMapper.MapEntityType(Type タイプ) で System.Data.Entity.ModelConfiguration.Mappers.NavigationPropertyMapper.Map(PropertyInfo propertyInfo, EdmEntityType entityType, Func 1 entityTypeConfiguration, Type sourceType) at System.Data.Entity.ModelConfiguration.Mappers.PropertyMapper.Map(PropertyInfo propertyInfo, EdmEntityType entityType, Func1 entityTypeConfiguration, Type sourceType) で System.Data.Entity.ModelConfiguration.Mappers.TypeMapper .<>c_ DisplayClass12.b1 annotations, ActionSystem.Data.Entity.ModelConfiguration.Mappers.TypeMapper.MapStructuralElements(Type タイプ、ICollection 2 propertyMappingAction、ブール値 mapDeclaredPropertiesOnly、Func 1.MoveNext() で System.Data.Entity.ModelConfiguration.Utilitiesで _e(PropertyMapper m、PropertyInfo p) 1 structuralTypeConfiguration) at System.Data.Entity.ModelConfiguration.Mappers.TypeMapper.MapEntityType(Type type) at System.Data.Entity.DbModelBuilder.<>c__DisplayClass7.<MapTypes>b__1(Type type) at System.Linq.Enumerable.WhereListIterator1 ts, ActionSystem.Data.Entity.DbModelBuilder.MapTypes(EdmModel モデル) のIEnumerableExtensions.Each (IEnumerable 1 アクション) DbConnection providerConnection) System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) で System.Data.Entity.Internal.RetryLazy 2.GetValue(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet1.Initialize() で System.Data.Entity.Internal.Linq.InternalSet1.get_InternalContext() at System.Data.Entity.Infrastructure.DbQuery1.System.Linq.IQueryable.get_Provider() の System.Linq.Queryable.FirstOrDefault(IQueryable 1 source, Expression1 predicate) の Calamos.Ccs.Research.Repository.Test.DatabaseContext.EntityFrameworkContexts.ResearchContextTest.TestFactorPeriod() の ResearchContextTest.cs: 行290

4

0 に答える 0