Hi Doron
1st i m complaining long time now that i do not receive mails from the post that i m subscribed could u please check my account again. it is very important to me. please do some tests/checks on that
2nd see this code
[Test]
[VerifyMocks]
[ClearMocks]
public void Test()
{
var searchAlwaysEnableController = Isolate.Fake.Instance<testClass>(Members.CallOriginal);
Isolate.SwapNextInstance<testClass>().With(searchAlwaysEnableController);
Assert.IsNotNull(searchAlwaysEnableController.Active);
Assert.IsNotNull(new testClass().Active);
}
public class testClass
{
private BoolList activeList;
protected internal testClass()
{
activeList = new BoolList(false);
}
[Browsable(false)]
public BoolList Active
{
get { return activeList; }
}
}
public class BoolList
{
public static implicit operator bool(BoolList b)
{
return b.ResultValue;
}
public static bool operator ==(BoolList a, bool b)
{
return a.Equals(b);
}
public static bool operator !=(BoolList a, bool b)
{
return !a.Equals(b);
}
public static bool operator !(BoolList a)
{
return !a.resultValue;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
public override bool Equals(object obj)
{
if (obj is bool)
{
return ((bool)obj) == resultValue;
}
return base.Equals(obj);
}
private bool oldResultValue;
private bool resultValue;
private bool emptyListValue;
private int lockCount;
private LightDictionary<string, bool> list = new LightDictionary<string, bool>();
private BoolListOperatorType operatorType = BoolListOperatorType.And;
protected void OnResultValueChanged(bool oldResultValue, bool resultValue)
{
if (ResultValueChanged != null)
{
ResultValueChanged(this, new BoolValueChangedEventArgs(oldResultValue, resultValue));
}
}
public BoolList(bool emptyListValue, BoolListOperatorType operatorType)
{
this.emptyListValue = emptyListValue;
this.resultValue = emptyListValue;
this.operatorType = operatorType;
}
public BoolList(bool emptyListValue) : this(emptyListValue, BoolListOperatorType.And) { }
public BoolList() : this(true, BoolListOperatorType.And) { }
public bool ResultValue
{
get
{
return resultValue;
}
}
public bool this[string key]
{
get
{
return list[key];
}
set
{
BeginUpdate();
try
{
list[key] = value;
}
finally
{
EndUpdate();
}
}
}
public void Clear()
{
BeginUpdate();
try
{
list.Clear();
}
finally
{
EndUpdate();
}
}
public void RemoveItem(string key)
{
BeginUpdate();
try
{
list.Remove(key);
}
finally
{
EndUpdate();
}
}
public void SetItemValue(string key, bool value)
{
this[key] = value;
}
public IEnumerable<string&