annotate Agendas/trunk/src/Agendas.Tests/TestBase.cs @ 54:3059a5f8930f

Code cleanup
author nelopauselli
date Sat, 14 May 2011 13:01:24 -0300
parents 3ebe89c88caa
children db4b1e2cae49
rev   line source
34
475be11edf56 Ajuste en los nombre de los assemblies y namespaces
nelo@MTEySS.neluz.int
parents: 24
diff changeset
1 using AltNetHispano.Agendas.Domain;
22
d6e124e5c9c4 DefaultEventoRepository en tests
nelo@MTEySS.neluz.int
parents: 20
diff changeset
2 using AltNetHispano.Agendas.Domain.Repositories;
34
475be11edf56 Ajuste en los nombre de los assemblies y namespaces
nelo@MTEySS.neluz.int
parents: 24
diff changeset
3 using AltNetHispano.Agendas.Repositories.Memory;
20
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
4 using Moq;
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
5 using NUnit.Framework;
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
6
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
7 namespace AltNetHispano.Agendas.Tests
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
8 {
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
9 public class TestBase
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
10 {
22
d6e124e5c9c4 DefaultEventoRepository en tests
nelo@MTEySS.neluz.int
parents: 20
diff changeset
11 protected static IEventoRepository DefaultEventoRepository
d6e124e5c9c4 DefaultEventoRepository en tests
nelo@MTEySS.neluz.int
parents: 20
diff changeset
12 {
d6e124e5c9c4 DefaultEventoRepository en tests
nelo@MTEySS.neluz.int
parents: 20
diff changeset
13 get { return new EventoRepository(); }
d6e124e5c9c4 DefaultEventoRepository en tests
nelo@MTEySS.neluz.int
parents: 20
diff changeset
14 }
d6e124e5c9c4 DefaultEventoRepository en tests
nelo@MTEySS.neluz.int
parents: 20
diff changeset
15
24
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
16 protected static IPonenteRepository DefaultPonenteRepository
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
17 {
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
18 get { return new PonenteRepository(); }
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
19 }
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
20
20
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
21 [SetUp]
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
22 public void LimpiarEventos()
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
23 {
24
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
24 EventoRepository.Clear();
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
25 }
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
26
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
27 [SetUp]
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
28 public void LimpiarPonentes()
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
29 {
41b283d27e3e Ponentes como entidad
nelo@MTEySS.neluz.int
parents: 22
diff changeset
30 PonenteRepository.Clear();
20
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
31 }
50
3ebe89c88caa Agregando propiedad al Evento sobre el Usuario que lo crea o que realizó la
nelopauselli
parents: 34
diff changeset
32
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
33 [SetUp]
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
34 public void SetearUsuario()
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
35 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
36 SetCurrentUser("neluz");
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
37 }
50
3ebe89c88caa Agregando propiedad al Evento sobre el Usuario que lo crea o que realizó la
nelopauselli
parents: 34
diff changeset
38
54
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
39 protected static void SetCurrentUser(string username)
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
40 {
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
41 var seguridad = new Mock<ISeguridad>();
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
42 seguridad.Setup(s => s.GetUserName()).Returns(username);
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
43 IdentityContext.Current = seguridad.Object;
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
44 }
3059a5f8930f Code cleanup
nelopauselli
parents: 50
diff changeset
45 }
20
c5a99dde072f reorganizando tests
nelo@MTEySS.neluz.int
parents:
diff changeset
46 }