Я использую VS2010. Silverlight 4, NUnit 2.5.5 и TypeMock TypemockIsolatorSetup6.0.3.619.msiИспытание модуля Silverlight. Ошибка при запуске тестов
В тестовом проекте MVVM реализован PeopleViewModel - это ViewModel, который я хочу проверить.
Пожалуйста, сообщите, если вы используете другие продукты для модульного тестирования MVVM Silverlight. Или, пожалуйста, помогите выиграть этот TypeMock. ТИА
Это код теста:
[Test]
[SilverlightUnitTest]
public void SomeTestAgainstSilverlight()
{
PeopleViewModel o = new PeopleViewModel();
var res = o.People;
Assert.AreEqual(15, res.Count());
}
Во время выполнения теста в ReSharper я получаю следующее сообщение об ошибке:
TestA.SomeTestAgainstSilverlight : Failed******************************************
*Loading Silverlight Isolation Aspects...*
******************************************
TEST RESULTS:
---------------------------------------------
System.MissingMethodException : Method not found: 'hv TypeMock.ArrangeActAssert.Isolate.a(System.Delegate)'.
at a4.a(ref Delegate A_0)
at a4.a(Boolean A_0)
at il.b()
at CThru.Silverlight.SilverlightUnitTestAttribute.Init()
at CThru.Silverlight.SilverlightUnitTestAttribute.Execute()
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
at Tests.TestA.SomeTestAgainstSilverlight() in TestA.cs: line 21
При выполнении теста в NUnit я получаю:
Tests.TestA.SomeTestAgainstSilverlight:
System.DllNotFoundException : Unable to load DLL 'agcore': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at MS.Internal.XcpImports.Application_GetCurrentNative(IntPtr context, IntPtr& obj)
at MS.Internal.XcpImports.Application_GetCurrent(IntPtr& pApp)
at System.Windows.Application.get_Current()
at ViewModelExample.ViewModel.ViewModelBase.get_IsDesignTime() in C:\Documents and Settings\USER\Desktop\ViewModelExample\ViewModelExample\ViewModel\ViewModelBase.cs:line 20
at ViewModelExample.ViewModel.PeopleViewModel..ctor(IServiceAgent serviceAgent) in C:\Documents and Settings\USER\Desktop\ViewModelExample\ViewModelExample\ViewModel\PeopleViewModel.cs:line 28
at ViewModelExample.ViewModel.PeopleViewModel..ctor() in C:\Documents and Settings\USER\Desktop\ViewModelExample\ViewModelExample\ViewModel\PeopleViewModel.cs:line 24
at Tests.TestA.SomeTestAgainstSilverlight() in C:\Documents and Settings\USER\Desktop\ViewModelExample\Tests\TestA.cs:line 22
ОБНОВЛЕНИЕ: Я не отвечаю на вопрос. Я переключился на другие инструменты.
Я предполагаю, что это конфликт между SL и .NET 4.0 core dlls. Вы можете попытаться решить эту проблему, настроив ссылки на httpaths dll на уровне системы из файлов проекта и используя «extern alias». –