1
/* Copyright (c) 2007 Google Inc.
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
7
* http://www.apache.org/licenses/LICENSE-2.0
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.
16
* Oct 13 2008 Joe Feser joseph.feser@gmail.com
17
* Converted ArrayLists and other .NET 1.1 collections to use Generics
18
* Combined IExtensionElement and IExtensionElementFactory interfaces
22
using NUnit.Framework;
23
using Google.GData.Client;
24
using Google.GData.Extensions.Apps;
25
using Google.GData.Extensions;
27
namespace Google.GData.Apps.UnitTests
30
[Category("GoogleApps")]
31
public class MailItemPropertyCollectionTest
33
private ExtensionCollection<MailItemPropertyElement> mailItemProperties;
38
mailItemProperties = new ExtensionCollection<MailItemPropertyElement>(new AtomEntry());
48
public void GetInitialSizeTest()
50
Assert.IsTrue(mailItemProperties.Count ==0, "Mail item property collection should initially be empty.");
54
public void InsertionTest()
56
mailItemProperties.Add(MailItemPropertyElement.STARRED);
58
Assert.AreEqual(1, mailItemProperties.Count,
59
"Mail item property collection should have size 1 after insertion");
60
Assert.AreEqual(0, mailItemProperties.IndexOf(MailItemPropertyElement.STARRED),
61
"Index of singleton mail item property should be zero");
62
Assert.IsTrue(mailItemProperties.Contains(MailItemPropertyElement.STARRED),
63
"Mail item property collection does not contain property after insertion");
67
public void DeletionTest()
69
mailItemProperties.Add(MailItemPropertyElement.TRASH);
70
mailItemProperties.Remove(MailItemPropertyElement.TRASH);
72
Assert.IsTrue(mailItemProperties.Count==0,
73
"Mail item property collection should be empty after singleton element is removed");