forked from ButchersBoy/Dragablz
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'll admit, this is the first time I've used git.
- Loading branch information
0 parents
commit 9d3ec68
Showing
75 changed files
with
6,065 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Security; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.CSharp; | ||
using NUnit.Framework; | ||
using Rhino.Mocks; | ||
|
||
namespace Dragablz.Test | ||
{ | ||
[TestFixture] | ||
public class CollectionTeaserFixture | ||
{ | ||
[Test] | ||
public void WillCreateForList() | ||
{ | ||
var myList = new ArrayList(); | ||
|
||
CollectionTeaser collectionTeaser; | ||
var result = CollectionTeaser.TryCreate(myList, out collectionTeaser); | ||
|
||
Assert.IsTrue(result); | ||
Assert.IsNotNull(collectionTeaser); | ||
} | ||
|
||
[Test] | ||
public void WillCreateForGenericCollection() | ||
{ | ||
var myList = MockRepository.GenerateStub<ICollection<string>>(); | ||
|
||
CollectionTeaser collectionTeaser; | ||
var result = CollectionTeaser.TryCreate(myList, out collectionTeaser); | ||
|
||
Assert.IsTrue(result); | ||
Assert.IsNotNull(collectionTeaser); | ||
} | ||
|
||
[Test] | ||
public void WillCreateForCollection() | ||
{ | ||
var myList = MockRepository.GenerateStub<ICollection>(); | ||
|
||
CollectionTeaser collectionTeaser; | ||
var result = CollectionTeaser.TryCreate(myList, out collectionTeaser); | ||
|
||
Assert.IsFalse(result); | ||
Assert.IsNull(collectionTeaser); | ||
} | ||
|
||
[Test] | ||
public void WillAddForList() | ||
{ | ||
var myList = new ArrayList(); | ||
CollectionTeaser collectionTeaser; | ||
Assert.IsTrue(CollectionTeaser.TryCreate(myList, out collectionTeaser)); | ||
|
||
collectionTeaser.Add("i am going to type this in, manually, twice."); | ||
|
||
CollectionAssert.AreEquivalent(new[] {"i am going to type this in, manually, twice."}, myList); | ||
//i didnt really. i copied and pasted it. | ||
} | ||
|
||
[Test] | ||
public void WillRemoveForList() | ||
{ | ||
var myList = new ArrayList | ||
{ | ||
1, | ||
2, | ||
3, | ||
4, | ||
5 | ||
}; | ||
CollectionTeaser collectionTeaser; | ||
Assert.IsTrue(CollectionTeaser.TryCreate(myList, out collectionTeaser)); | ||
|
||
collectionTeaser.Remove(3); | ||
|
||
CollectionAssert.AreEquivalent(new[] {1, 2, 4, 5}, myList); | ||
} | ||
|
||
[Test] | ||
public void WillAddForGenericCollection() | ||
{ | ||
var myList = MockRepository.GenerateStub<ICollection<string>>(); | ||
CollectionTeaser collectionTeaser; | ||
Assert.IsTrue(CollectionTeaser.TryCreate(myList, out collectionTeaser)); | ||
|
||
collectionTeaser.Add("hello"); | ||
|
||
myList.AssertWasCalled(c => c.Add("hello")); | ||
myList.AssertWasNotCalled(c => c.Remove("hello")); | ||
} | ||
|
||
[Test] | ||
public void WillRemoveForGenericCollection() | ||
{ | ||
var myList = MockRepository.GenerateStub<ICollection<string>>(); | ||
CollectionTeaser collectionTeaser; | ||
Assert.IsTrue(CollectionTeaser.TryCreate(myList, out collectionTeaser)); | ||
|
||
collectionTeaser.Remove("bye"); | ||
|
||
myList.AssertWasCalled(c => c.Remove("bye")); | ||
myList.AssertWasNotCalled(c => c.Add("bye")); | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.