From 4db44afa0c6f7e49ae93465ea860613d5431a6e2 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sat, 22 Oct 2016 17:02:15 +0200 Subject: [PATCH] no? maybe now? --- src/tests/Tests.cs | 107 ----------------------------------------- src/tests/project.json | 30 ------------ src/tests/tests.xproj | 21 -------- 3 files changed, 158 deletions(-) delete mode 100644 src/tests/Tests.cs delete mode 100644 src/tests/project.json delete mode 100644 src/tests/tests.xproj diff --git a/src/tests/Tests.cs b/src/tests/Tests.cs deleted file mode 100644 index 520b5fbf..00000000 --- a/src/tests/Tests.cs +++ /dev/null @@ -1,107 +0,0 @@ -using NadekoBot.Modules.Permissions; -using NadekoBot.Services.Database.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using Xunit; - -namespace Tests -{ - public class Tests - { - - private Permission GetRoot() - { - Permission root = new Permission(); - root.SecondaryTargetName = "Root"; - var cur = root; - for (var i = 1; i < 10; i++) - { - var p = new Permission(); - p.SecondaryTargetName = i.ToString(); - p.Previous = cur; - cur.Next = p; - cur = p; - } - return root; - } - [Fact] - public void CountTest() - { - var root = GetRoot(); - - Assert.Equal(10, root.Count()); - } - - [Fact] - public void AddTest() - { - var root = GetRoot(); - - root.Prepend(new Permission() { SecondaryTargetName = "Added" }); - - root = root.GetRoot(); - - Assert.Equal(11, root.Count()); - - Assert.Equal("Added", root.AsEnumerable().First().SecondaryTargetName); - } - - [Fact] - public void GetAtTest() - { - var root = GetRoot(); - Assert.Equal("Root", root.GetAt(0).SecondaryTargetName); - Assert.Equal("1", root.GetAt(1).SecondaryTargetName); - Assert.Equal("5", root.GetAt(5).SecondaryTargetName); - Assert.Equal("9", root.GetAt(9).SecondaryTargetName); - - Assert.Throws(typeof(IndexOutOfRangeException), () => { root.GetAt(-5); }); - Assert.Throws(typeof(IndexOutOfRangeException), () => { root.GetAt(10); }); - } - - //[Fact] - //public void InsertTest() { - - // var root = GetRoot(); - - // root.Insert(5, new Permission() { SecondaryTargetName = "in2" }); - - // Assert.Equal(11, root.Count()); - // Assert.Equal("in2", root.GetAt(5).SecondaryTargetName); - - // root.Insert(0, new Permission() { SecondaryTargetName = "Inserted" }); - - // root = root.Previous; - // Assert.Equal("Inserted", root.SecondaryTargetName); - // Assert.Equal(12, root.Count()); - // Assert.Equal("Root", root.GetAt(1).SecondaryTargetName); - - // Assert.Throws(typeof(IndexOutOfRangeException), () => { root.GetAt(12); }); - //} - - [Fact] - public void RemoveAtTest() - { - var root = GetRoot(); - - var removed = root.RemoveAt(3); - - Assert.Equal("3", removed.SecondaryTargetName); - Assert.Equal(9, root.Count()); - Assert.Throws(typeof(IndexOutOfRangeException), () => { root.RemoveAt(0); }); - Assert.Throws(typeof(IndexOutOfRangeException), () => { root.RemoveAt(9); }); - Assert.Throws(typeof(IndexOutOfRangeException), () => { root.RemoveAt(-1); }); - } - - [Fact] - public void TestGetRoot() - { - var root = GetRoot(); - - var random = root.GetAt(5).GetRoot(); - - Assert.Equal("Root", random.SecondaryTargetName); - } - } -} diff --git a/src/tests/project.json b/src/tests/project.json deleted file mode 100644 index 252ce594..00000000 --- a/src/tests/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable" - }, - "dependencies": { - "System.Runtime.Serialization.Primitives": "4.1.1", - "xunit": "2.1.0", - "dotnet-test-xunit": "1.0.0-rc2-192208-24", - "NadekoBot": "1.0.0-*" - }, - "testRunner": "xunit", - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0" - } - }, - "imports": [ - "dotnet5.4", - "portable-net451+win8" - ] - } - }, - "configurations": { - "GlobalNadeko": {} - } -} diff --git a/src/tests/tests.xproj b/src/tests/tests.xproj deleted file mode 100644 index eaf88e51..00000000 --- a/src/tests/tests.xproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - 14.0.25420 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 14cbada0-971c-44e3-b331-c7d01dd74f0b - tests - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file