Beispiel #1
0
 /// <summary>
 /// Craig Barkley
 /// Created: 2019/01/28
 /// Create new event type
 /// </summary>
 ///
 /// <remarks>
 ///  Adds if the return is true.
 /// </remarks>
 private void BtnEventTypeAction_Click(object sender, RoutedEventArgs e)
 {
     createNewEventType();
     if (_result == true)
     {
         try
         {
             var result = _eventTypeManager.AddEventType(_newType);
             //add if this returns true
             if (result == true)
             {
                 this.DialogResult = true;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Event Type Added");
         }
     }
 }
Beispiel #2
0
        public void TestCreateEventTypeValidInput()
        {
            bool expectedResult = true;
            bool actualResult;

            // arrange
            EventType testEventType = new EventType()
            {
                EventTypeID = "GoodID",
                Description = "Good  Long Description",
            };

            // act
            actualResult = eventManager.AddEventType(testEventType);

            // assert - check if EventType was added
            Assert.AreEqual(expectedResult, actualResult);
        }