Skip to content

Integration with Prism #1

Description

@aboo

I'm trying to use SpecFlow.Xamarin.Forms with a Prism.Forms. I get all sorts of error regarding Autofac unable to find the constructor for navigation. My view model is having a Prism Unity INavigationService. I ended up mocking the navigation service similar to the following:

public class MyAppTest: TestApp 
 {...
    protected override void InitialiseContainer()
    {
        var logger = Substitute.For<ILoggerFacade>();
        var applicationProvider = Substitute.For<IApplicationProvider>();
        var container =Substitute.For<IUnityContainer>();
        Resolver.Instance.Register<INavigationService>(new UnityPageNavigationService(container, applicationProvider, logger));
        base.InitialiseContainer();
    }
}

I passed that step but the issue got worst with giving and error message when initializing a task which I think is caused because of Mocking.

I kind of feel like this is not the way to go and somehow the Prism need to be integrated with SpecFlow or replace Autofac.

I was hoping if someone can provide a hint or maybe a small sample project. I've already Googled for hours but couldn't find anything.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions