using System.Collections;
using System.Collections.Generic;
public class TestSpeedLimit
public void test_When_Vehicle_Is_OverSpeeding()
FakeSpeedProvider fakeSpeedProvider = new FakeSpeedProvider();
ThresholdLimit = fakeSpeedProvider.ProvideThersoldLImit("Loc1");
SpeedChecker speedChecker = new SpeedChecker();
speedLimitExceeded= speedChecker.CheckSpeedLimit(ThresholdLimit, 40);
Assert.AreEqual(false, speedLimitExceeded );
public class FakeSpeedProvider : SpeedProvider
public int ProvideThersoldLImit(string Location)
public interface SpeedProvider
public int ProvideThersoldLImit(string Location);
public class SpeedChecker
public bool CheckSpeedLimit(int thresholdLimit, int vehiclespeed)
bool speedLimitExces = false;
if (vehiclespeed > thresholdLimit)
public static void Main()
var x = new NUnitLite.AutoRun().Execute(new string[]{"--test:TestSpeedLimit", "--noc"});
Console.WriteLine("----------------------------------------------");
Console.WriteLine(x==0?"All Test Passed... :¬)": string.Format("{0} tests failed... :¬(", x));