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); }
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); }