public void Return_Null_Object_When_Not_Found() { var auto = new AutomobileRepository().FindById("foo"); Assert.Equal(Automobile.Null, auto); Assert.Empty(auto.Start()); Assert.Empty(auto.Stop()); }
public void Return_Concrete_Automobile() { var auto = new AutomobileRepository().FindById("mini"); Assert.NotEqual(Automobile.Null, auto); Assert.Equal("Mini Start", auto.Start()); Assert.Equal("Mini Stop", auto.Stop()); }
public VehicleService(AutomobileRepository automobileRepository) { _automobileRepository = automobileRepository; }