-
-
Notifications
You must be signed in to change notification settings - Fork 261
/
Copy pathFileStateTests.cs
40 lines (33 loc) · 1.04 KB
/
FileStateTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Parse.Platform.Files;
namespace Parse.Tests;
[TestClass]
public class FileStateTests
{
[TestMethod]
public void TestSecureUrl()
{
Uri unsecureUri = new Uri("http://files.parsetfss.com/yolo.txt");
Uri secureUri = new Uri("https://files.parsetfss.com/yolo.txt");
Uri randomUri = new Uri("http://random.server.local/file.foo");
FileState state = new FileState
{
Name = "A",
Location = unsecureUri,
MediaType = null
};
Assert.AreEqual(unsecureUri, state.Location);
Assert.AreEqual(secureUri, state.SecureLocation);
// Make sure the proper port was given back.
Assert.AreEqual(443, state.SecureLocation.Port);
state = new FileState
{
Name = "B",
Location = randomUri,
MediaType = null
};
Assert.AreEqual(randomUri, state.Location);
Assert.AreEqual(randomUri, state.Location);
}
}