Advertisement
IvetValcheva

Untitled

Dec 7th, 2022
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.51 KB | None | 0 0
  1. using BarberShop;
  2. using NUnit.Framework;
  3. using System.Collections.Generic;
  4.  
  5. public class Test_21
  6. {
  7.     private BarberShop.BarberShop barberShop;
  8.     private Barber b1 = new Barber("a", 1, 1);
  9.     private Barber b2 = new Barber("b", 2, 3);
  10.     private Barber b3 = new Barber("c", 2, 2);
  11.  
  12.     private Client c1 = new Client("a", 1, Gender.MALE);
  13.     private Client c2 = new Client("b", 1, Gender.FEMALE);
  14.     private Client c3 = new Client("c", 2, Gender.FEMALE);
  15.     private Client c4 = new Client("d", 6, Gender.FEMALE);
  16.     private Client c5 = new Client("e", 5, Gender.FEMALE);
  17.  
  18.     [SetUp]
  19.     public void Setup()
  20.     {
  21.         this.barberShop = new BarberShop.BarberShop();
  22.     }
  23.  
  24.     [Test]
  25.     public void TestGetAllBarbersSortedWithClientsCountDesc()
  26.     {
  27.         this.barberShop.AddBarber(b1);
  28.         this.barberShop.AddBarber(b2);
  29.         this.barberShop.AddBarber(b3);
  30.         this.barberShop.AddClient(c1);
  31.         this.barberShop.AddClient(c2);
  32.         this.barberShop.AddClient(c3);
  33.         this.barberShop.AddClient(c4);
  34.         this.barberShop.AddClient(c5);
  35.         this.barberShop.AssignClient(b1, c1);
  36.         this.barberShop.AssignClient(b1, c2);
  37.         this.barberShop.AssignClient(b1, c3);
  38.         this.barberShop.AssignClient(b2, c4);
  39.         this.barberShop.AssignClient(b2, c5);
  40.  
  41.         var res = this.barberShop.GetAllBarbersSortedWithClientsCountDesc();
  42.         var expected = new List<Barber>() { b1, b2, b3 };
  43.         CollectionAssert.AreEqual(res, expected);
  44.     }
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement