Advertisement
IvetValcheva

Тест 15

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