Beispiel #1
0
        public static ViewModels.MainWindowViewModel GetMainWindowViewModelStub(bool license = true, bool hasKey = true)
        {
            var read = new FakeLicenseReader();

            read.state = license;

            return(new ViewModels.MainWindowViewModel(new KeyManager(new DataProvider(), new FakeKeyManagerReader(hasKey)), new DataProvider(), read, DialogCoordinator.Instance, true));
        }
Beispiel #2
0
        public void LicenseWriter_ReadAgreementStateAgreementTrue_ReadsStateCorrectly()
        {
            var reader = new FakeLicenseReader();

            reader.multiple = true;
            reader.state    = true;

            LicenseWriter writer = new LicenseWriter(reader);

            Assert.IsTrue(writer.ReadAgreementState());
        }
Beispiel #3
0
        public void LicenseWriter_ReadAgreementStateAgreementTrue_UpdatesStateInManagerCorrectly()
        {
            LicenseManager.LicensesAccepted = false;

            var reader = new FakeLicenseReader();

            reader.multiple = true;
            reader.state    = true;

            LicenseWriter writer = new LicenseWriter(reader);

            writer.ReadAgreementState();

            Assert.IsTrue(LicenseManager.LicensesAccepted);
        }
Beispiel #4
0
        public void LicenseWriter_WriteAgreementStateWithoutOtherParameters_WritesLicenseCorrectly()
        {
            var reader = new FakeLicenseReader();

            reader.multiple = false;

            LicenseWriter writer = new LicenseWriter(reader);

            writer.WriteAgreementState(false);

            foreach (string s in reader.NewFile)
            {
                if (s == "LIAG:False")
                {
                    Assert.Pass();
                }
            }

            Assert.Fail();
        }