public void Handle(EventArgs eventArgs)
 {
     TimetableChangedEventArgs e = eventArgs as TimetableChangedEventArgs;
     if (e != null)
     {
         AddOrUpdateLoadtestsValidationResult addOrUpdateValidationResult = e.AddOrUpdateLoadtestsValidationResult;
         if ((addOrUpdateValidationResult.ToBeInserted.Any() || addOrUpdateValidationResult.ToBeUpdated.Any())
                 && !addOrUpdateValidationResult.Failed.Any())
         {
             EmailArguments args = new EmailArguments("Load tests added or updated", "Load tests added or updated", "The Boss", "The developer", "123.456.678");
             _emailService.SendEmail(args);
         }
     }
 }
		public async Task<AddOrUpdateLoadtestsResponse> AddOrUpdateLoadtestsAsync(AddOrUpdateLoadtestsRequest addOrUpdateLoadtestsRequest)
		{
			AddOrUpdateLoadtestsResponse resp = await _innerTimetableService.AddOrUpdateLoadtestsAsync(addOrUpdateLoadtestsRequest);
			if (resp.Exception == null)
			{
				AddOrUpdateLoadtestsValidationResult addOrUpdateValidationResult = resp.AddOrUpdateLoadtestsValidationResult;
				if ((addOrUpdateValidationResult.ToBeInserted.Any() || addOrUpdateValidationResult.ToBeUpdated.Any())
					&& !addOrUpdateValidationResult.Failed.Any())
				{
					EmailArguments args = new EmailArguments("Load tests added or updated", "Load tests added or updated", "The Boss", "The developer", "123.456.678");
					_emailService.SendEmail(args);
				}
			}
			return resp;
		}
Exemplo n.º 3
0
        public async Task <AddOrUpdateLoadtestsResponse> AddOrUpdateLoadtestsAsync(AddOrUpdateLoadtestsRequest addOrUpdateLoadtestsRequest)
        {
            AddOrUpdateLoadtestsResponse resp = await _innerTimetableService.AddOrUpdateLoadtestsAsync(addOrUpdateLoadtestsRequest);

            if (resp.Exception == null)
            {
                AddOrUpdateLoadtestsValidationResult addOrUpdateValidationResult = resp.AddOrUpdateLoadtestsValidationResult;
                if ((addOrUpdateValidationResult.ToBeInserted.Any() || addOrUpdateValidationResult.ToBeUpdated.Any()) &&
                    !addOrUpdateValidationResult.Failed.Any())
                {
                    EmailArguments args = new EmailArguments("Load tests added or updated", "Load tests added or updated", "The Boss", "The developer", "123.456.678");
                    _emailService.SendEmail(args);
                }
            }
            return(resp);
        }
Exemplo n.º 4
0
        public async Task <AddOrUpdateLoadtestsResponse> AddOrUpdateLoadtestsAsync(AddOrUpdateLoadtestsRequest request)
        {
            AddOrUpdateLoadtestsResponse resp = await _innerTimetableService.AddOrUpdateLoadtestsAsync(request);

            if (resp.Exception == null)
            {
                AddOrUpdateLoadTestsValidationResult validationResult = resp.AddOrUpdateLoadtestsValidationResult;
                if ((validationResult.ToBeInserted.Any() || validationResult.ToBeUpdated.Any()) &&
                    !validationResult.Failed.Any())
                {
                    EmailArguments args = new EmailArguments("Load tests added or updated", "Load tests added or updated", "My boss", "Developer1", "127.0.0.1");
                    _emailService.SendMail(args);
                }
            }

            return(resp);
        }
Exemplo n.º 5
0
 public void EmailArgumentsEmptySmtpServerTest()
 {
     var emailArguments = new EmailArguments("a", "a", "a", "a", null);
 }
Exemplo n.º 6
0
 public void EmailArgumentsEmptyFromTest()
 {
     var emailArguments = new EmailArguments("a", "a", "a", null, "a");
 }
Exemplo n.º 7
0
 public void EmailArgumentsEmptyMessagetTest()
 {
     var emailArguments = new EmailArguments("a", null, "a", "a", "a");
 }
Exemplo n.º 8
0
 public void EmailArgumentsEmptySubjectTest()
 {
     var emailArguments = new EmailArguments(null, "a", "a", "a", "a");
 }