2
* Copyright 2010 Canonical Ltd.
4
* This file is part of Ubuntu One on Windows.
6
* Ubuntu One on Windows is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License version
8
* as published by the Free Software Foundation.
10
* Ubuntu One on Windows is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with Ubuntu One for Windows. If not, see <http://www.gnu.org/licenses/>.
18
* Authors: Manuel de la Peña <manuel.delapena@canonical.com>
20
using System.Collections;
21
using System.Collections.Generic;
22
using NUnit.Framework;
24
namespace Canonical.Ubuntu.SSO.Tests
27
public class CredentialsFoundEventArgsFixture
31
private CredentialsFoundEventArgs _args;
38
public void EmptyConstructorTest()
40
_args = new CredentialsFoundEventArgs();
41
Assert.AreEqual(string.Empty, _args.ApplicationName);
42
Assert.IsEmpty((ICollection)_args.Credentials.Values);
45
[TestCase("UbuntuOne", "token", "tokenSecret", "consumerKey", "consumerSecret")]
46
[TestCase("Tomboy", "tomboyToken", "tomboyToeknSecret", "tomboyConsumerKey", "tomboyConsumerSecret")]
47
public void AppNameCredentialsConstructor(string appName, string token, string tokenSecret,
48
string consumerKey, string consumerSecret )
50
// create the dict with the data
51
var credentials = new Dictionary<string, string>
54
{"TokenSecret", tokenSecret},
55
{"ConsumerKey", consumerKey},
56
{"ConsumerSecret", consumerSecret}
58
_args = new CredentialsFoundEventArgs(appName, credentials);
59
Assert.AreEqual(appName, _args.ApplicationName);
60
Assert.AreSame(credentials, _args.Credentials);