~ubuntu-branches/debian/squeeze/gnome-do-plugins/squeeze

« back to all changes in this revision

Viewing changes to BundledLibraries/libgoogle-data-mono-1.4.0.2/src/unittests/spreadsheets/cellentrytest.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2009-06-27 16:11:49 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627161149-b74nc297di2842u1
* New upstream release
  + Pidgin plugin now supports initial text for messages (LP: #338608)
  + Pidgin plugin opens conversations on the correct IM network (LP: #370965)
* debian/rules:
  + Update get-orig-source target.  Upstream no longer ships gdata* binaries,
    so we no longer need to strip them
* debian/patches/00_use_system_gdata
  + Drop.  Upstream now builds against system libgdata.
* debian/patches/04_fix_pidgin_dbus_ints
* debian/patches/10_fix_rhythmbox_file
* debian/patches/15_twitter_api
* debian/patches/20_twitter_overflow:
  + Drop.  Included upstream.
* debian/patches/01_firefox_iceweasel_rename:
  + Refresh for new version
* debian/patches/02_fix_banshee_plugin:
  + Drop refernce to /usr/lib/banshee-1/Banshee.CollectionIndexer.dll.
    This is unnecessary, and causes errors when Banshee isn't installed.
* debian/patches/00_debian_default_plugins:
  + Enable a bunch of useful plugins that do not require configuration from 
    the "Official" plugin set by default.  Makes Do more useful out of the 
    box.
* debian/control:
  + Bump versioned build-dep on gnome-do to 0.8.2
  + Split out gnome-do-plugin-evolution package, now that this is possible.
    libevolution5.0-cil has an annoyingly large dependency stack.
    (LP: #351535) (Closes: #524993).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2006 Google Inc.
2
 
 *
3
 
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 
 * you may not use this file except in compliance with the License.
5
 
 * You may obtain a copy of the License at
6
 
 *
7
 
 *     http://www.apache.org/licenses/LICENSE-2.0
8
 
 *
9
 
 * Unless required by applicable law or agreed to in writing, software
10
 
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 
 * See the License for the specific language governing permissions and
13
 
 * limitations under the License.
14
 
 */
15
 
 
16
 
using System;
17
 
using System.IO;
18
 
using System.Text;
19
 
using System.Xml;
20
 
using NUnit.Framework;
21
 
using Google.GData.Client;
22
 
using Google.GData.Extensions;
23
 
 
24
 
namespace Google.GData.Spreadsheets.UnitTests
25
 
{
26
 
    [TestFixture]
27
 
    [Category("GoogleSpreadsheets")]
28
 
    public class CellEntryTest
29
 
    {
30
 
        private CellEntry entry;
31
 
        private CellEntry.CellElement cell;
32
 
        private Random rng;
33
 
 
34
 
        [SetUp]
35
 
        public void Init()
36
 
        {
37
 
            entry = new CellEntry();
38
 
            cell = new CellEntry.CellElement();
39
 
            rng = new Random();
40
 
        }
41
 
 
42
 
        [TearDown]
43
 
        public void Dispose()
44
 
        {
45
 
 
46
 
        }
47
 
 
48
 
        [Test]
49
 
        public void GetCellTest()
50
 
        {
51
 
            Assert.IsNotNull(entry.Cell);
52
 
        }
53
 
 
54
 
        [Test]
55
 
        public void SetCellTest()
56
 
        {
57
 
            entry.Cell = cell;
58
 
            Assert.AreEqual(cell, entry.Cell);
59
 
        }
60
 
 
61
 
        [Test]
62
 
        public void SaveAndReadTest()
63
 
        {
64
 
            StringBuilder sb = new StringBuilder();
65
 
            XmlWriter writer = new XmlTextWriter(new StringWriter(sb));
66
 
            uint row = (uint)rng.Next();
67
 
            cell.Row = row;
68
 
            uint column = (uint)rng.Next();
69
 
            cell.Column = column;
70
 
            cell.InputValue = "input string";
71
 
            cell.NumericValue = "numeric value";
72
 
            cell.Value = "display value";
73
 
            cell.Save(writer);
74
 
            writer.Close();
75
 
 
76
 
            XmlDocument document = new XmlDocument();
77
 
            document.LoadXml(sb.ToString());
78
 
 
79
 
            ExtensionElementEventArgs e = new ExtensionElementEventArgs();
80
 
            e.ExtensionElement = document.FirstChild;
81
 
 
82
 
            entry.Parse(e, new AtomFeedParser());
83
 
 
84
 
            Assert.AreEqual(row, entry.Cell.Row, "Rows should be equal");
85
 
            Assert.AreEqual(column, entry.Cell.Column, "Columns should be equal");
86
 
            Assert.AreEqual("input string", entry.Cell.InputValue, "Input value should be equal");
87
 
            Assert.AreEqual("numeric value", entry.Cell.NumericValue, "Numeric value should be equal");
88
 
            Assert.AreEqual("display value", entry.Cell.Value, "Cell value should be equal");
89
 
        }
90
 
    }
91
 
}