Exemplo n.º 1
0
        public SettingsViewModel(Settings settings, MainWindowViewModel mainWindowViewModel, LotteryTicketChecker lotteryTicketChecker)
        {
            this.settings = settings;
            this.mainWindowViewModel = mainWindowViewModel;
            this.lotteryTicketChecker = lotteryTicketChecker;

            this.Address = this.settings.Address;
            this.Port = this.settings.Port.ToString();
            this.IsSelfHost = this.settings.IsSelfHost;

            this.Save = new RelayCommand(this.HandleSave);
            this.Backup = new RelayCommand(() => BackupDatabaseService.Backup(this.settings.BackupPath));
            this.Cancel = new RelayCommand(() => this.mainWindowViewModel.ShowLogin());
            this.LotteryLogin = new RelayCommand(this.HandleLotteryLogin);
        }
 public LotteryTicketCheckerViewModel(LotteryTicketChecker lotteryTicketChecker)
 {
     this.lotteryTicketChecker = lotteryTicketChecker;
 }
Exemplo n.º 3
0
        public void NotWinnerNimbersCheckTest(int[] winNumbers, int[] ticketNumbers)
        {
            var checker = new LotteryTicketChecker(winNumbers);

            Assert.IsFalse(checker.IsWinTicket(ticketNumbers));
        }