Mercurial > altnet-hispano
annotate Agendas/trunk/src/Agendas.Tests/Workflows/WorkflowMemoryTests.cs @ 200:5346c0500594 deploy pre 1.0
Pasando a estructura de db fija, ya no se crea automáticamente.
Se comenta lo referente a Patrocinadores que queda para alguna futura versión.
Script para tablas de v1.0
author | nelopauselli |
---|---|
date | Wed, 17 Aug 2011 17:54:45 -0300 |
parents | 6ee05ceea8c3 |
children |
rev | line source |
---|---|
181 | 1 using System; |
2 using System.Collections.Generic; | |
3 using AltNetHispano.Agendas.Domain; | |
4 using Moq; | |
5 using NUnit.Framework; | |
6 | |
7 namespace AltNetHispano.Agendas.Tests.Workflows | |
8 { | |
9 [TestFixture] | |
10 public class WorkflowMemoryTests : TestBase | |
11 { | |
12 private Mock<IPublicador> _publicador; | |
13 private Workflow _workflow; | |
14 | |
15 [SetUp] | |
16 public void InitPublicador() | |
17 { | |
18 _publicador = new Mock<IPublicador>(); | |
200
5346c0500594
Pasando a estructura de db fija, ya no se crea automáticamente.
nelopauselli
parents:
181
diff
changeset
|
19 _workflow = new Workflow(_publicador.Object, DefaultEventoRepository, DefaultPersonaRepository, () => new Mock<IDisposable>().Object); |
181 | 20 } |
21 | |
22 [Test] | |
23 public void Proponer() | |
24 { | |
25 _workflow.Proponer(); | |
26 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Once()); | |
27 } | |
28 | |
29 [Test] | |
30 public void Proponer_y_agendar() | |
31 { | |
32 _workflow.Proponer(); | |
33 | |
34 _workflow.Agendar(); | |
35 | |
36 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(2)); | |
37 } | |
38 | |
39 [Test] | |
40 public void Proponer_agendar_y_cancelar() | |
41 { | |
42 _workflow.Proponer(); | |
43 | |
44 _workflow.Agendar(); | |
45 | |
46 _workflow.Cancelar(); | |
47 | |
48 _publicador.Verify(p=>p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(3)); | |
49 } | |
50 | |
51 [Test] | |
52 public void Proponer_agendar_cancelar_y_reagendar() | |
53 { | |
54 _workflow.Proponer(); | |
55 | |
56 _workflow.Agendar(); | |
57 | |
58 _workflow.Cancelar(); | |
59 | |
60 _workflow.ReAgendar(); | |
61 | |
62 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(4)); | |
63 } | |
64 | |
65 [Test] | |
66 public void Proponer_agendar_cancelar_reproponer_agendar_y_confirmar() | |
67 { | |
68 _workflow.Proponer(); | |
69 | |
70 _workflow.Agendar(); | |
71 | |
72 _workflow.Cancelar(); | |
73 | |
74 _workflow.ReProponer(); | |
75 | |
76 _workflow.Agendar(); | |
77 | |
78 _workflow.Confirmar(); | |
79 | |
80 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(6)); | |
81 } | |
82 | |
83 [Test] | |
84 public void Proponer_agendar_cancelar_reagendar_y_confirmar() | |
85 { | |
86 _workflow.Proponer(); | |
87 | |
88 _workflow.Agendar(); | |
89 | |
90 _workflow.Cancelar(); | |
91 | |
92 _workflow.ReAgendar(); | |
93 | |
94 _workflow.Confirmar(); | |
95 | |
96 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(5)); | |
97 } | |
98 | |
99 [Test] | |
100 public void Proponer_agendar_cancelar_y_reproponer() | |
101 { | |
102 _workflow.Proponer(); | |
103 | |
104 _workflow.Agendar(); | |
105 | |
106 _workflow.Cancelar(); | |
107 | |
108 _workflow.ReProponer(); | |
109 | |
110 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(4)); | |
111 } | |
112 | |
113 [Test] | |
114 public void Proponer_y_descartar() | |
115 { | |
116 _workflow.Proponer(); | |
117 | |
118 _workflow.Descartar(); | |
119 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(2)); | |
120 } | |
121 | |
122 [Test] | |
123 public void Proponer_agendar_cancelar_y_descartar() | |
124 { | |
125 _workflow.Proponer(); | |
126 | |
127 _workflow.Agendar(); | |
128 | |
129 _workflow.Cancelar(); | |
130 | |
131 _workflow.Descartar(); | |
132 | |
133 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(4)); | |
134 } | |
135 | |
136 [Test] | |
137 public void Proponer_agendar_y_confirmar() | |
138 { | |
139 _workflow.Proponer(); | |
140 | |
141 _workflow.Agendar(); | |
142 | |
143 _workflow.Confirmar(); | |
144 | |
145 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(3)); | |
146 } | |
147 | |
148 [Test] | |
149 public void Proponer_agendar_confirmar_publicar() | |
150 { | |
151 const string urlWiki = "http://www.altnethispano.org/wiki/van-2010-10-21-mono-cecil.ashx"; | |
152 | |
153 _workflow.Proponer(); | |
154 | |
155 _workflow.Agendar(); | |
156 | |
157 _workflow.Confirmar(); | |
158 | |
159 _workflow.Publicar(); | |
160 | |
161 _publicador.Verify(p => p.Publicar(It.IsAny<IEnumerable<Track>>()), Times.Exactly(4)); | |
162 } | |
163 } | |
164 } |