forked from CrustyJew/RedditSharp-DEPRECATED-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnitTest1.cs
More file actions
28 lines (26 loc) · 826 Bytes
/
UnitTest1.cs
File metadata and controls
28 lines (26 loc) · 826 Bytes
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
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RedditSharp;
using RedditSharp.Things;
namespace UnitTesting
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void GetSubreddit()
{ //Discovered a bug where reddit.getSubreddit() will produce a 403 forbidden if you're not logged in
if (System.Text.RegularExpressions.Regex.Replace("/r/text", "(r/|/)", "") != "text")
throw new Exception("The regexes don't work!");
}
[TestMethod]
public void TestSpoilers()
{
Reddit reddit = new Reddit();
if (!reddit.GetSubreddit("talesfromtechsupport").SpoilersEnabled)
{
throw new Exception("The Spoilers must be found!");
}
}
}
}