Advertisement
IvetValcheva

Тест 15

Dec 8th, 2022
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using TripAdministrations;
  2. using NUnit.Framework;
  3. using System;
  4.  
  5. class Test_22
  6. {
  7.     private TripAdministrator tripAdministrations;
  8.  
  9.     private Company c1 = new Company("a", 2);
  10.     private Company c2 = new Company("b", 1);
  11.     private Company c3 = new Company("c", 1);
  12.     private Company c4 = new Company("d", 2);
  13.  
  14.     private Trip t1 = new Trip("a", 1, Transportation.NONE, 1);
  15.     private Trip t2 = new Trip("b", 1, Transportation.BUS, 1);
  16.     private Trip t3 = new Trip("c", 1, Transportation.BUS, 1);
  17.     private Trip t4 = new Trip("d", 1, Transportation.BUS, 1);
  18.  
  19.     [SetUp]
  20.     public void Setup()
  21.     {
  22.         this.tripAdministrations = new TripAdministrator();
  23.     }
  24.  
  25.     [Test]
  26.     public void TestExecuteTripWithWithRemovedCompany()
  27.     {
  28.         this.tripAdministrations.AddCompany(c1);
  29.         this.tripAdministrations.AddTrip(c1, t1);
  30.         this.tripAdministrations.RemoveCompany(c1);
  31.  
  32.         Assert.Throws<ArgumentException>(() => this.tripAdministrations.ExecuteTrip(c1, t1));
  33.     }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement