Esempio n. 1
0
        protected NU_Base()
        {
            Certificates cert = new Certificates();
              X509Certificate2 certificate = cert.GetByTaxNumber(MyTaxNumber);

              this.settings = Settings.CreateTestSettings(certificate);
              this.taxService = TaxService.Create(this.settings);
        }
Esempio n. 2
0
    public void CalculateTest()
    {
      string appPath = new Uri(Path.GetDirectoryName(typeof(NU_Certificate).Assembly.EscapedCodeBase)).LocalPath;
      string fileCertPath = Path.Combine(appPath, @"UnitTests\resources\file.pfx");

      Certificates cert = new Certificates();
      X509Certificate2 fileCert = cert.GetFromFile(fileCertPath, null);

      RSACryptoServiceProvider provider = Certificates.getCryptoProvider(fileCert);

      string input = @"test";
      string output = this.pm.Calculate(input, provider);
      Assert.AreEqual(output, "0b77e05986aea28cace92a85a4443838");
    }
Esempio n. 3
0
        public void SendWholeTest()
        {
            var certificateHelper = new Certificates();
              var certificate = certificateHelper.GetByTaxNumber(MyTaxNumber);
              var settings = Settings.CreateTestSettings(certificate);
              var ts = TaxService.Create(settings);

              ReturnValue rv = ts.SendEcho("This is echo message");
              Assert.IsNullOrEmpty(rv.ErrorMessage);
              Assert.AreEqual(rv.Step, SendingStep.MessageSend);
              Assert.True(rv.Success);
              Assert.IsNotNull(rv.MessageSendToFurs);
              Assert.IsNotNull(rv.MessageReceivedFromFurs);
              Assert.IsNullOrEmpty(rv.ProtectedID);
              Assert.IsNullOrEmpty(rv.UniqueInvoiceID);
        }
Esempio n. 4
0
    private void init()
    {
      this.FursEndPoints = new ObservableCollection<Tuple<string, string>>();
      this.FursEndPoints.Add(new Tuple<string, string>("TEST / TEST (https://blagajne-test.fu.gov.si:9002/v1/cash_registers)", @"https://blagajne-test.fu.gov.si:9002/v1/cash_registers"));
      this.FursEndPoints.Add(new Tuple<string, string>("Produkcija / Production (https://blagajne.fu.gov.si:9003/v1/cash_registers)", @"https://blagajne.fu.gov.si:9003/v1/cash_registers"));

      Certificates cert = new Certificates();
      this.Certificates = new ObservableCollection<X509Certificate2>();
      foreach (var certificate in cert.GetAllFursCertificates())
        this.Certificates.Add(certificate);

      this.Timeouts = new ObservableCollection<string>();
      for (int i = 1; i < 11; i++)
        this.Timeouts.Add(string.Format("{0} sec", i));

      this.cbType.SelectedIndex = 0;
      this.cbCertificates.SelectedIndex = 0;
      this.cbTimeout.SelectedIndex = 1;
      this.showExample(this.btnEcho);
      this.showResults(null);
    }
Esempio n. 5
0
 private RSACryptoServiceProvider GetCryptoProvider()
 {
     return(Certificates.getCryptoProvider(this.Certificate));
 }