Ejemplo n.º 1
0
        public void generating_otp(string pinString, string secretString, DateTime genTime, string expectedResult)
        {
            Secret.TryCreate(secretString, out var secret);
            Pin.TryCreate(pinString, out var pin);
            var yaotp = new Yaotp(secret, pin, () => genTime);

            var result = yaotp.ComputeOtp();

            Assert.Equal(result, expectedResult);
        }
Ejemplo n.º 2
0
        public ViewForm(Yaotp yaotp, PwEntry entry, IPluginHost host)
        {
            _yaotp = yaotp ?? throw new ArgumentNullException(nameof(yaotp));
            _host  = host ?? throw new ArgumentNullException(nameof(host));
            _entry = entry ?? throw new ArgumentNullException(nameof(entry));

            InitializeComponent();

            this.Icon         = host.MainWindow.Icon;
            timerUpdate.Tick += UpdateUI;
        }