public MainViewModel(UserViewModel userViewModel) { if (userViewModel == null) throw new ArgumentNullException(nameof(userViewModel)); User = userViewModel; }
public NavigationServiceTest() { var builder = new ContainerBuilder(); var user = new UserViewModel(new Mock<IUser>().Object); builder.RegisterInstance(new MainViewModel(user)); builder.RegisterType<NavigationService>().AsSelf().As<INavigationService>(); builder.RegisterType<DummyClass>().AsSelf().Keyed<IContentViewModel>(Keys.Value1); builder.RegisterType<TestClass>().AsSelf().Keyed<IContentViewModel>(Keys.Value2); builder.RegisterType<ContentScope>(); container = builder.Build(); main = container.Resolve<MainViewModel>(); }