~crisoagf/do-plugins/do-music

« back to all changes in this revision

Viewing changes to BundledLibraries/telepathy-sharp/tests/Main.cs

  • Committer: Christopher James Halse Rogers
  • Date: 2011-02-06 08:01:08 UTC
  • mfrom: (687.1.12 empathy)
  • Revision ID: raof@ubuntu.com-20110206080108-cuzq3femqkmsiagy
Merge the long-sought Empathy plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright (C) 2009 Neil Loknath <neil.loknath@gmail.com>
 
3
 * 
 
4
 *   This program is free software: you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU Lesser General Public License as published 
 
6
 *   by the Free Software Foundation, either version 3 of the License, or
 
7
 *   (at your option) any later version.
 
8
 *
 
9
 *   This program is distributed in the hope that it will be useful,
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *   GNU Lesser General Public License for more details.
 
13
 *
 
14
 *   You should have received a copy of the GNU Lesser General Public License
 
15
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 *   This program is free software: you can redistribute it and/or modify
 
17
 *   it under the terms of the GNU LesserGeneral Public License as published 
 
18
 *   by the Free Software Foundation, either version 3 of the License, or
 
19
 *   (at your option) any later version.
 
20
 */
 
21
 
 
22
using System;
 
23
 
 
24
namespace tests
 
25
{
 
26
    
 
27
    
 
28
    class MainStage
 
29
    {
 
30
        enum TestType
 
31
        {
 
32
            Misc, MissionControl, DTube, FileTransfer
 
33
        };
 
34
        
 
35
        public static void Main(string[] args)
 
36
        {
 
37
            
 
38
            TestType type = TestType.Misc;   
 
39
            
 
40
            if (args.Length > 0) {
 
41
                if (!args[0].StartsWith ("--")) {
 
42
                    DisplayUsage ();
 
43
                    return;
 
44
                }
 
45
                else {
 
46
                    if (args[0].Equals ("--misc")) type = TestType.Misc;
 
47
                    else if (args[0].Equals ("--missioncontrol")) type = TestType.MissionControl;
 
48
                    else if (args[0].Equals ("--dtube")) type = TestType.DTube;
 
49
                    else if (args[0].Equals ("--filetransfer")) type = TestType.FileTransfer;
 
50
                    else {
 
51
                        DisplayUsage ();
 
52
                        return;
 
53
                    }
 
54
                }
 
55
            }
 
56
            
 
57
            string account = "jabber3";
 
58
            string contact = "banshee_test1@jabber.org";
 
59
            
 
60
            switch (type) {
 
61
                case TestType.Misc:
 
62
                    MiscTest t = new MiscTest ();
 
63
                    t.Initialize ();
 
64
                    break;
 
65
                case TestType.MissionControl:
 
66
                    McTest mct = new McTest ();
 
67
                    mct.Initialize ();
 
68
                    break;
 
69
                case TestType.DTube:    
 
70
                    
 
71
                    if (args.Length > 2) {
 
72
                        account = args[1];
 
73
                        contact = args[2];
 
74
                    }
 
75
                    else if (args.Length == 2) {
 
76
                        account = args[1];
 
77
                        contact = null;
 
78
                    }
 
79
                                
 
80
                    DTubeTest tube = new DTubeTest (account, contact);
 
81
                    tube.Initialize ();
 
82
                    break;
 
83
                case TestType.FileTransfer:
 
84
                                        
 
85
                    if (args.Length > 2) {
 
86
                        account = args[1];
 
87
                        contact = args[2];
 
88
                    }
 
89
                    else if (args.Length == 2) {
 
90
                        account = args[1];
 
91
                        contact = null;
 
92
                    }
 
93
                
 
94
                    FileTransfer ft = new FileTransfer (account, contact);
 
95
                    ft.Initialize ();
 
96
                    break;
 
97
                          
 
98
            }
 
99
             
 
100
        }
 
101
    
 
102
        private static void DisplayUsage ()
 
103
        {
 
104
            string usage = "tests.exe [options]";
 
105
            string options = "Valid options:\n --misc\n --missioncontrol\n --dtube [account]\n --filetransfer [account]";
 
106
            
 
107
            Console.WriteLine (usage);
 
108
            Console.WriteLine (options);
 
109
        }
 
110
        
 
111
    }
 
112
}
 
 
b'\\ No newline at end of file'