public void ShouldThrowArgumentOutOfRangeException() { //Arrange var analyserType = "SomeOtherDriver"; //Act & Assert var exception = Assert.Throws <ArgumentOutOfRangeException>(() => AnalyserLookup.GetAnalyser(analyserType)); }
public void ShouldThrowExceptionForEmptyInput() { // Arrange var analyserType = ""; // Act and Assert Assert.Throws <ArgumentNullException>(() => AnalyserLookup.GetAnalyser(analyserType)); }
public void ShouldThrowErrorForWrongInput() { //Assign var analyserType = "invalid"; //Act //Assert Assert.Throws(typeof(ArgumentOutOfRangeException), delegate { AnalyserLookup.GetAnalyser(analyserType); }); }
public void ShouldCreateFriendlyAnalyserInstance() { //Arrange var analyserType = "Friendly"; //Act var analyserInstance = AnalyserLookup.GetAnalyser(analyserType); //Assert Assert.IsInstanceOf(typeof(FriendlyAnalyser), analyserInstance); }
public void ShouldCreateGetawayDriverAnalyserInstance() { //Arrange var analyserType = "Getaway"; //Act var analyserInstance = AnalyserLookup.GetAnalyser(analyserType); //Assert Assert.IsInstanceOf(typeof(GetawayDriverAnalyser), analyserInstance); }
public void ShouldCreateFormulaOneDriverAnalyserInstance() { //Arrange var analyserType = "FormulaOne"; //Act var analyserInstance = AnalyserLookup.GetAnalyser(analyserType); //Assert Assert.IsInstanceOf(typeof(FormulaOneAnalyser), analyserInstance); }
public AnalyseHistoryCommand(IReadOnlyCollection <string> arguments) { var analysisType = arguments.Count() > 1 ? arguments.First() : arguments.Single(); bool bypass; bool.TryParse(arguments.ElementAt(1), out bypass); // Never mind exception here BypassPenlty = bypass; DataSourcePath = arguments.Count() > 2 ? arguments.ElementAt(2) : string.Empty; _analyser = AnalyserLookup.GetAnalyser(analysisType); }
public void ShouldGetFormulaOneWithPenaltyDriverAnalyser() { //Assign var analyserType = "formula_one_driver_with_penalty"; //Act var analyser = AnalyserLookup.GetAnalyser(analyserType); //Assert Assert.AreEqual(typeof(FormulaOneAnalyser), analyser.GetType()); }
public AnalyseHistoryCommand(IReadOnlyCollection <string> arguments) { //Read the first argument which is analyser type var analysisType = arguments.ElementAt(0); //Read the second argument which is name of the file from which data is to be loaded for anlysis _source = arguments.ElementAt(1); //Get appropriate analyzer instance based on type _analyser = AnalyserLookup.GetAnalyser(analysisType); }
public void ShouldGetGetawayDriverWithPenaltyAnalyser() { //Assign var analyserType = "getaway_driver_with_penalty"; //Act var analyser = AnalyserLookup.GetAnalyser(analyserType); //Assert Assert.AreEqual(typeof(GetawayDriverAnalyser), analyser.GetType()); }
public void ShouldGetDeliveryDriverAnalyser() { //Assign var analyserType = "delivery_driver"; //Act var analyser = AnalyserLookup.GetAnalyser(analyserType); //Assert Assert.AreEqual(typeof(DeliveryDriverAnalyser), analyser.GetType()); }
public void ShouldReturnGetawayDriverAnalyserForValidInput() { // Arrange var analyserType = "getaway"; // Act var analyser = AnalyserLookup.GetAnalyser(analyserType); // Assert Assert.IsInstanceOf(typeof(GetawayDriverAnalyser), analyser); }
public void ShouldReturnFormulaOneDriverAnalyserForValidInput() { // Arrange var analyserType = "formulaone"; // Act var analyser = AnalyserLookup.GetAnalyser(analyserType); // Assert Assert.IsInstanceOf(typeof(FormulaOneAnalyser), analyser); }
public AnalyseHistoryCommand(IReadOnlyCollection <string> arguments) { var analysisType = arguments.ElementAt(0); if (arguments.Count > 1 && arguments.ElementAt(1) != null) { _drivingDataFilePath = arguments.ElementAt(1); } _analyser = AnalyserLookup.GetAnalyser(analysisType); if (arguments.Count > 2 && arguments.ElementAt(2) != null && arguments.ElementAt(2).ToLower() == "true") { _penalise = true; } }
public void ShouldThrowExceptionForInvalidInput() { var analyserType = "driver"; Assert.Throws <ArgumentException>(() => AnalyserLookup.GetAnalyser(analyserType)); }
public void ShouldThrowExceptionForNullInput() { Assert.Throws <ArgumentNullException>(() => AnalyserLookup.GetAnalyser(null)); }
public AnalyseHistoryCommand(IReadOnlyCollection <string> arguments) { var analysisType = arguments.Single(); _analyser = AnalyserLookup.GetAnalyser(analysisType); }