public void IndexPropertyWhenRefTypeAndNotFoundReturnNull() { IWithIndexers with = MockRepository.Mock <IWithIndexers>(); with.ExpectProperty(x => x["", 3]); Assert.Null(with["", 2]); }
public void IndexPropertyWhenValueTypeAndNotFoundThrows() { IWithIndexers with = MockRepository.Mock <IWithIndexers>(); with.ExpectProperty(x => x[1]); Assert.Throws <InvalidOperationException>( () => GC.KeepAlive(with[1])); }
public void IndexPropertyWhenRefTypeAndNotFoundReturnNull() { IWithIndexers with = MockRepository.Mock <IWithIndexers>(); with.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); with.ExpectProperty(x => x["", 3]); Assert.Null(with["", 2]); }
public void IndexPropertyWhenValueTypeAndNotFoundThrows() { IWithIndexers with = MockRepository.Mock <IWithIndexers>(); with.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); with.ExpectProperty(x => x[1]); Assert.Throws <InvalidOperationException>( () => GC.KeepAlive(with[1])); }