Duration
Cold symptoms usually appear 2 or 3 days after exposure to a source of infection. Most colds clear up within 1 week, but some last for as long as 2 weeks.
Source: Common Cold
Hah. I should be so lucky!
[TestFixture]
public class Program
{
static void Main(string[] args){}
[Test]
public void ChrisDoesntWriteCodeWhenSick()
{
IDeveloper chris = new Chris(new InsaneCommonColdThatLastsForAMonth());
Assert.IsFalse(chris.CanWriteCode());
}
}
public interface IDeveloper
{
bool CanWriteCode();
}
public class Chris : IDeveloper
{
private IHealth currentHealth;
public Chris(IHealth currentHealth)
{
this.currentHealth = currentHealth;
currentHealth.AnnounceHealth();
}
public bool CanWriteCode()
{
return currentHealth.CanWorkToday;
}
}
public interface IHealth
{
bool CanWorkToday { get; }
void AnnounceHealth();
}
public class InsaneCommonColdThatLastsForAMonth : IHealth
{
public bool CanWorkToday
{
get { return false; }
}
public void AnnounceHealth()
{
Console.WriteLine("CoughCoughCough...");
Console.WriteLine("Ouch! My head!");
}
}