My unitTests not longer work after Update from Kentico 9 to Kentico 10.
I have a UnitTest like this. (worked fine on Kentico 9)
[SetUp]
public void setUp()
{
this.pageCreator = new PageCreator();
this.fixture = new Fixture();
this.fixture.Customize(new AutoMoqCustomization());
}
[Test]
public void execute()
{
this.pageCreator.Execute(null);
}
I just try to call this Function
public class PageCreator : ITask
{
public string Execute(TaskInfo task)
{
try
{
this.treeProvider = new TreeProvider(MembershipContext.AuthenticatedUser);
this.createPages(this.treeProvider);
return successMessage;
}
catch (Exception ex)
{
this.sendMailToDeveloper(ex.Message);
return "Fail";
}
The Problem is, when I try run my test, I get an Error (because of MembershipContext.AuthenticatedUser [CMS.Membership.MembershipContext.AuthenticatedUser" hat eine Ausnahme vom Typ "System.InvalidOperationException" verursacht])
When I try to make the same in debugMode, everything is working fine.
What can be the problem and how can I fix it ?
I have load all the new Dll from Kentico 10 but nothing changed.
Thanks for your help

