Here is the code:
public interface IAccessPoint
{
int BackHaulMaximum { get; set; }
bool BackHaulMaximumReached();
void EmailNetworkProvider();
}
public class AccessPoint : IAccessPoint
{
public int BackHaulMaximum { get; set; }
public bool BackHaulMaximumReached()
{
if (BackHaulMaximum > 80)
{
EmailNetworkProvider();
return true;
}
return false;
}
public void EmailNetworkProvider()
{
}
}
//Test
[Test]
public void NetworkProviderShouldBeEmailedWhenBackHaulMaximumIsReached()
{
var apMock = MockRepository.GenerateMock<IAccessPoint>();
apMock.Stub(x => x.BackHaulMaximum).Return(81);
Assert.AreEqual(true, apMock.BackHaulMaximumReached());
apMock.AssertWasCalled(x => x.EmailNetworkProvider());
}