public void Notifies_All_Screen_When_Selected_License_Changes()
        {
            var userData = new UserDataViewModel() as IUserDataViewModel;
            var licenseInfo = new LicenseInfoViewModel() as ILicenseInfoViewModel;

            var vm = new IssueLicenseViewModel(userData, licenseInfo);

            Assert.Same(vm.CurrentLicense, userData.CurrentLicense);
            Assert.Same(vm.CurrentLicense, licenseInfo.CurrentLicense);
        }
Ejemplo n.º 2
0
        public void Can_Issues_New_License()
        {
            var vm = CreateViewModel();
            var issueVm = new IssueLicenseViewModel();

            _viewModelFactory.Expect(f => f.Create<IssueLicenseViewModel>()).Return(issueVm);
            _windowManager.Expect(w => w.ShowDialog(Arg.Is(issueVm), Arg<object>.Is.Null)).Return(true);

            vm.CurrentProject = new Project { Product = new Product() };
            vm.AddLicense();

            Assert.Equal(1, vm.CurrentProject.Product.IssuedLicenses.Count);
        }