コード例 #1
0
        public void Z_RemoveOpeningTest()
        {
            OpeningsService.RemoveOpening(Opening);
            var removedOpening = OpeningsService.GetOpeningFromId(Opening.Id);

            Assert.AreEqual(removedOpening.Id, -1);
        }
コード例 #2
0
        public void AddOpeningTest()
        {
            var random     = new Random();
            var newOpening = new Opening()
            {
                DateTimeStart         = DateTime.Now,
                DateTimeEnd           = DateTime.Now.AddDays(5),
                Company               = new Company(),
                HourlyPay             = random.Next(),
                Placements            = new List <Placement>(),
                RequiredQualification = new Qualification(),
                Job = new Job()
            };

            Opening = OpeningsService.AddOpening(newOpening);
        }
コード例 #3
0
        public void GetAllOpeningsTest()
        {
            var openings = OpeningsService.GetAllOpenings();

            foreach (var v in openings)
            {
                Console.WriteLine();
                Console.WriteLine($"Company Name\t\t{v.Company.Name}");
                Console.WriteLine($"Reqd QualificationsString\t{v.RequiredQualification.Code}");
                Console.WriteLine($"Placement Count\t{v.Placements.Count}");
                Console.WriteLine($"DateTime Start\t{v.DateTimeStart}");
                Console.WriteLine($"DateTime End\t{v.DateTimeEnd}");
                Console.WriteLine($"Hourly Pay\t\t{v.HourlyPay}");
                Console.WriteLine();
            }
        }
コード例 #4
0
        public void Y_TestAddedOpening()
        {
            var addedOpening = OpeningsService.GetOpeningFromId(Opening.Id);

            Assert.AreEqual(addedOpening.HourlyPay, Opening.HourlyPay);
        }
コード例 #5
0
        //[TestCase(1, 77f)]
        //[TestCase(2, 23f)]
        //[TestCase(3, 75f)]
        //[TestCase(4, 56f)]
        //[TestCase(5, 76f)]
        public void GetOpeningFromIdTest(int id, float result)
        {
            var opening = OpeningsService.GetOpeningFromId(id);

            Assert.AreEqual(opening.HourlyPay, result);
        }
コード例 #6
0
 public OpeningServiceTest()
 {
     TecAppContext   = new TecAppContext();
     OpeningsService = new OpeningsService(TecAppContext);
 }