Example #1
0
 public Vat7SaveServiceTest()
 {
     _budgetParams = new BudzetParametersCollection {
         NazwaUrzedu = "Test123", Regon = "1231341", Nip = "5353123"
     };
     _vatParams = new Vat7PrintParams {
         Year = 2016, Month = 3, CelZlozenia = "2", KodUrzedu = "ee"
     };
     _xml      = XDocument.Parse("<vat7><rok>2099</rok></vat7>");
     _vat7Data = new Vat7Data {
         P01 = 100.00, P02 = 200.00
     };
     _versions = new List <Vat7Dao> {
         new Vat7Dao {
             Version = 1
         }, new Vat7Dao {
             Version = 3
         }
     };
     _session          = new Session();
     _objectFactory    = Substitute.For <IObjectFactory>();
     _vatObjectFactory = Substitute.For <IVatObjectFactory>();
     _vatObjectFactory.ObjectFactory.Returns(_objectFactory);
     _service = new Vat7SaveService(_vatObjectFactory);
     _vatObjectFactory.GetVat7DictionaryProvider().GetVersions(_session, _vatParams.Year, _vatParams.Month).Returns(_versions);
     _vatObjectFactory.GetVat7DataService().Get(_session, _vatParams.Year, _vatParams.Month).Returns(_vat7Data);
     _objectFactory.GetXmlSerializer <Vat7Data>().Serialize(_vat7Data).Returns(_xml);
     _objectFactory.GetBudzetParametersCollectionGetter().GetParameters(_session).Returns(_budgetParams);
 }
Example #2
0
        public void Save(Session session, Vat7PrintParams vatParams)
        {
            _session   = session;
            _vatParams = vatParams;

            ValidateParams();
            GetVersionNumber();
            GetVat7Data();
            UpdateVat7DataBudgetParams();
            UpdateVat7DataPrintParams();
            VatVariantUpdata();
            ConvertVat7DataToXml();
            CreateItem();
            CreateCrud();
            SaveUsingCrud();
        }
Example #3
0
		public void Save(Session session, Vat7PrintParams vatParams)
		{
			_session = session;
			_vatParams = vatParams;

			ValidateParams();
			GetVersionNumber();
			GetVat7Data();
			UpdateVat7DataBudgetParams();
			UpdateVat7DataPrintParams();
			VatVariantUpdata();
			ConvertVat7DataToXml();
			CreateItem();
			CreateCrud();
			SaveUsingCrud();
		}
		public Vat7SaveServiceTest()
		{
			_budgetParams = new BudzetParametersCollection { NazwaUrzedu = "Test123", Regon = "1231341", Nip = "5353123" };
			_vatParams = new Vat7PrintParams {Year = 2016, Month = 3, CelZlozenia = "2", KodUrzedu = "ee"};
			_xml = XDocument.Parse("<vat7><rok>2099</rok></vat7>");
			_vat7Data = new Vat7Data {P01 = 100.00, P02 = 200.00};
			_versions = new List<Vat7Dao> {new Vat7Dao {Version = 1}, new Vat7Dao { Version = 3 } };
			_session = new Session();
			_objectFactory = Substitute.For<IObjectFactory>();
			_vatObjectFactory = Substitute.For<IVatObjectFactory>();
			_vatObjectFactory.ObjectFactory.Returns(_objectFactory);
			_service = new Vat7SaveService(_vatObjectFactory);
			_vatObjectFactory.GetVat7DictionaryProvider().GetVersions(_session, _vatParams.Year, _vatParams.Month).Returns(_versions);
			_vatObjectFactory.GetVat7DataService().Get(_session, _vatParams.Year, _vatParams.Month).Returns(_vat7Data);
			_objectFactory.GetXmlSerializer<Vat7Data>().Serialize(_vat7Data).Returns(_xml);
			_objectFactory.GetBudzetParametersCollectionGetter().GetParameters(_session).Returns(_budgetParams);
		}