Monday, January 18, 2016
Dev Tools
- Resharper
- Red Gate SQL Prompt
- SQL Search
- SQL Compare
- SQL Data Compare
- SQL Source Control
- SQL Doc
- Winmerge
- Agent Ransack
- Beyond Compare
- Royal TS
- DotPeek
- SoapUI
- Vagrant UP
- ELMAH
- Source Tree
- TurtoiseGit
Unit Test on Private Methods in C#
There is an object in Microsoft.VisualStudio.TestTools.UnitTesting (Not sure
about NUNIT) called PrivateObject
Usage:
namespace Tests
{
[TestClass]
public class Test1
{
[TestMethod]
public void NoDuplicateTest()
{
string[] fileList = Directory.GetFiles(@"\\TestData\NoDuplicates");
string backUpFolder = @"\\TestData\NoDuplicates\Sent\";
PrivateObject privateMethod = new PrivateObject(new ClassName(string.Empty,string.Empty));
var result = privateMethod.Invoke("MethodName", new[] {fileList.GetType(), backUpFolder.GetType()}, new object[] {fileList, backUpFolder});
Assert.IsTrue((bool)result);
}
}
}