Unit Tests
Test code in Elevated privileges
25/03/2013 13:34
[TestInitialize]
public void TestSetUpSettings()
{
target = new CustomAscxUserControlHelper();
//Enable RunWithElevated privileges
var spSecMock =...
Ignore base call method
25/03/2013 13:27
//Ignore Call base.OnLoad and base.OnInit in Unit test
//We use base.Onload in CustomAscxUserControl class
//Double 'CallBase.CallBase' is used because CustomAscxUserControlHelper inherits from CustomAscxUserControl.
var mock =...
Verify private method was called
20/10/2012 23:53
ClearCache(properties) is private static void function of ContactListReceiverClass
//Verify private static method was called
Isolate.Verify.NonPublic.WasCalled(typeof(ContactListReceiverClass),"ClearCache").WithArguments(properties);
//In case it's instance...
Test - call private method, or private static method
20/10/2012 21:55
//var underTest = new ContactListReceiverClass();
//Invoke normal method
var result = Isolate.Invoke.Method(underTest, "ClearCache", properties);
//Invoke static method
var result =...
Call private method from abstract class
27/09/2012 21:44
Using System.Linq;
public object InvokePrivate<T> (T instance, string methodName, params object[] obj)
{
var baseType = instance.GetType().BaseType;
...
Get protected property value
27/09/2012 21:43
//Create help public class
public class Class1 : MultiPageNavigationController
{
public Class1(INavigationConfiguration config) : base(config)
{
}
//create method to get...