public void vendiFotoStampaDirettaTest() { using (new UnitOfWorkScope(false)) { // Ho bisogno di una stampante con il formato carta A5 StampantiAbbinateCollection stampantiAbbinate = StampantiAbbinateUtil.deserializza(Configurazione.UserConfigLumen.stampantiAbbinate); // TODO il test presume che ci sia una stampante abbinata con la carta A5. // se non esiste, creare un abbinamento ad hoc. _impl.carrello.intestazione = VenditoreSrvImpl.INTESTAZIONE_STAMPA_RAPIDA; ParamStampaFoto p = ricavaParamStampa(); LumenEntities dbContext = UnitOfWorkScope.currentDbContext; List <Fotografia> fotos = (from f in dbContext.Fotografie.Include("fotografo") select f).Take(QUANTE).ToList(); contaStampate = 0; _impl.aggiungereStampe(fotos, p); _impl.vendereCarrello(); Assert.IsTrue(_impl.carrello.venduto); Assert.IsTrue(_impl.carrello.totaleAPagare > 0); } Console.WriteLine("FINITO"); }
public void TestListaAbbinamentiToString() { using (new UnitOfWorkScope(false)) { _impl = new StampantiAbbinateCollection(Configurazione.UserConfigLumen.stampantiAbbinate); System.Diagnostics.Trace.WriteLine("[Stampante]: " + _impl.serializzaToString()); } }
/// <summary> /// Partendo dalla stringa con gli abbinamenti, ricreo la collezione di oggetti. /// </summary> private void refresh() { if (IsInDesignMode) { // genero dei dati casuali DataGen <StampanteAbbinata> dg = new DataGen <StampanteAbbinata>(); formatiCartaAbbinati = new StampantiAbbinateCollection(dg.generaMolti(5)); } else { // Popolo la collezione partendo dalla stringa serializzata aumma aumma formatiCartaAbbinati = StampantiAbbinateUtil.deserializza(_strAbbinamenti); } }
public void TestListaAbbinamenti() { using (new UnitOfWorkScope(false)) { _impl = new StampantiAbbinateCollection(Configurazione.UserConfigLumen.stampantiAbbinate); foreach (StampanteAbbinata stampanteAbbinata in _impl) { System.Diagnostics.Trace.WriteLine("[Stampante]: " + stampanteAbbinata.StampanteInstallata.NomeStampante + " " + stampanteAbbinata.FormatoCarta.prezzo + " " + stampanteAbbinata.FormatoCarta.descrizione); } } Assert.IsTrue(String.IsNullOrEmpty(Configurazione.UserConfigLumen.stampantiAbbinate) && _impl.Count == 0); if (Configurazione.UserConfigLumen.stampantiAbbinate != null) { Assert.IsTrue(Configurazione.UserConfigLumen.stampantiAbbinate.Length > 0 && _impl.Count > 0); } }