comparison Agendas/trunk/src/Agendas.Configurations.Tests/Read_configuration.cs @ 158:734d3f0853bf

Manejando configuración de los publicadores con una sección propia en los .config Agregando la opción de habilitar / deshabilitar un publicador
author nelopauselli
date Fri, 05 Aug 2011 16:55:18 -0300
parents
children
comparison
equal deleted inserted replaced
157:f17252543cbf 158:734d3f0853bf
1 using AltNetHispano.Agendas.Configurations;
2 using NUnit.Framework;
3
4 namespace Agendas.Configurations.Tests
5 {
6 [TestFixture]
7 public class Read_configuration
8 {
9 [Test]
10 public void Read()
11 {
12 var section = AgendasConfigurationManager.Publicadores;
13 Assert.IsNotNull(section);
14 }
15
16 [Test]
17 public void Read_twitter()
18 {
19 var publicadores = AgendasConfigurationManager.Publicadores;
20 Assert.IsNotNull(publicadores);
21
22 Assert.IsNotNull(publicadores.Twitter);
23
24 var twitter = publicadores.Twitter;
25 Assert.AreEqual(true, twitter.Enabled);
26
27 Assert.IsNotNull(twitter.SignIn);
28 Assert.AreEqual("consumerKey1", twitter.SignIn.ConsumerKey);
29 Assert.AreEqual("consumerSecret1", twitter.SignIn.ConsumerSecret);
30
31 Assert.AreEqual("consumerKey2", twitter.SendTwitter.ConsumerKey);
32 Assert.AreEqual("consumerSecret2", twitter.SendTwitter.ConsumerSecret);
33 Assert.AreEqual("accessToken2", twitter.SendTwitter.AccessToken);
34 Assert.AreEqual("accessTokenSecret2", twitter.SendTwitter.AccessTokenSecret);
35 }
36
37 [Test]
38 public void Read_blog()
39 {
40 var publicadores = AgendasConfigurationManager.Publicadores;
41 Assert.IsNotNull(publicadores);
42
43 Assert.IsNotNull(publicadores.Blog);
44
45 var blog = publicadores.Blog;
46 Assert.AreEqual(true, blog.Enabled);
47
48 Assert.IsNotNull(blog.Writer);
49 Assert.AreEqual("blogName", blog.Writer.BlogName);
50 Assert.AreEqual("blogWriterMasterKey", blog.Writer.BlogWriterMasterKey);
51 Assert.AreEqual("postWriterServiceUrl", blog.Writer.PostWriterServiceUrl);
52 }
53
54 [Test]
55 public void Read_google()
56 {
57 var publicadores = AgendasConfigurationManager.Publicadores;
58 Assert.IsNotNull(publicadores);
59
60 Assert.IsNotNull(publicadores.Google);
61
62 var google = publicadores.Google;
63 Assert.AreEqual(true, google.Enabled);
64
65 Assert.IsNotNull(google.Calendar);
66 Assert.AreEqual("altnethispano.desa@gmail.com", google.Calendar.UserName);
67 Assert.AreEqual("altnethispano.desa@gmail.com", google.Calendar.CalendarId);
68 Assert.AreEqual("password", google.Calendar.Password);
69 }
70 }
71 }