public void Closing_ViewModel_Calls_TryClose_With_True_DialogResult() { var userData = new UserDataViewModel() as IUserDataViewModel; var licenseInfo = new LicenseInfoViewModel() as ILicenseInfoViewModel; var vm = new TestableIssueLicenseViewModel(userData, licenseInfo); vm.Accept(); Assert.NotNull(vm.SelectedDialogResult); Assert.True(vm.SelectedDialogResult.Value); }
public void Can_Accept_New_License_When_OwnerName_Is_Filled() { var userData = new UserDataViewModel() as IUserDataViewModel; var licenseInfo = new LicenseInfoViewModel() as ILicenseInfoViewModel; var vm = new TestableIssueLicenseViewModel(userData, licenseInfo); var defaultCanAccept = vm.CanAccept; vm.CurrentLicense.OwnerName = "John Doe"; var canAccept = vm.CanAccept; Assert.False(defaultCanAccept); Assert.True(canAccept); }