1
using Google.GData.Client;
3
using Google.GData.Client.UnitTests;
5
using System.Collections.Generic;
8
namespace Google.GData.Client.UnitTests.Core
13
///This is a test class for GDataRequestFactoryTest and is intended
14
///to contain all GDataRequestFactoryTest Unit Tests
16
[TestFixture][Category("CoreClient")]
17
public class GDataRequestFactoryTest
21
private TestContext testContextInstance;
24
///Gets or sets the test context which provides
25
///information about and functionality for the current test run.
27
public TestContext TestContext
31
return testContextInstance;
35
testContextInstance = value;
39
#region Additional test attributes
41
//You can use the following additional attributes as you write your tests:
43
//Use ClassInitialize to run code before running the first test in the class
45
//public static void MyClassInitialize(TestContext testContext)
49
//Use ClassCleanup to run code after all tests in a class have run
51
//public static void MyClassCleanup()
55
//Use TestInitialize to run code before running each test
57
//public void MyTestInitialize()
61
//Use TestCleanup to run code after each test has run
63
//public void MyTestCleanup()
71
///A test for UserAgent
74
public void UserAgentTest()
76
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
77
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
78
string expected = "TestValue"; string actual;
79
target.UserAgent = expected;
80
actual = target.UserAgent;
81
Assert.AreEqual(expected, actual);
88
public void UseGZipTest()
90
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
91
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
92
bool expected = true; // TODO: Initialize to an appropriate value
94
target.UseGZip = expected;
95
actual = target.UseGZip;
96
Assert.AreEqual(expected, actual);
100
///A test for Timeout
103
public void TimeoutTest()
105
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
106
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
107
int expected = 250000; // TODO: Initialize to an appropriate value
109
target.Timeout = expected;
110
actual = target.Timeout;
111
Assert.AreEqual(expected, actual);
118
public void SlugTest()
120
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
121
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
122
string expected = "TestValue";
124
target.Slug = expected;
125
actual = target.Slug;
126
Assert.AreEqual(expected, actual);
133
public void ProxyTest()
135
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
136
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
137
IWebProxy expected = new WebProxy();
139
target.Proxy = expected;
140
actual = target.Proxy;
141
Assert.AreEqual(expected, actual);
145
///A test for KeepAlive
148
public void KeepAliveTest()
150
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
151
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
152
bool expected = false; // TODO: Initialize to an appropriate value
154
target.KeepAlive = expected;
155
actual = target.KeepAlive;
156
Assert.AreEqual(expected, actual);
161
///A test for CustomHeaders
164
public void CustomHeadersTest()
166
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
167
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
169
actual = target.CustomHeaders;
170
Assert.IsNotNull(actual);
171
Assert.IsTrue(actual.Count == 0);
176
///A test for ContentType
179
public void ContentTypeTest()
181
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
182
GDataRequestFactory target = new GDataRequestFactory(userAgent); // TODO: Initialize to an appropriate value
183
string expected = "TestValue";
185
target.ContentType = expected;
186
actual = target.ContentType;
187
Assert.AreEqual(expected, actual);
191
///A test for GDataRequestFactory Constructor
194
public void GDataRequestFactoryConstructorTest()
196
string userAgent = "TestValue"; // TODO: Initialize to an appropriate value
197
GDataRequestFactory target = new GDataRequestFactory(userAgent);
198
Assert.IsNotNull(target);