public void CoreApplicationRegistryServiceMustBeLoggedInToRegister() { ApplicationRegistrationService svc = GetTestService(); string orgName = 5.RandomLetters(); string appName = 8.RandomLetters(); ProcessDescriptor descriptor = ProcessDescriptor.ForApplicationRegistration(svc.ApplicationRegistrationRepository, "localhost", 8080, appName, orgName); CoreServiceResponse response = svc.RegisterApplicationProcess(descriptor); Expect.IsFalse(response.Success); Expect.IsNotNull(response.Data); Expect.IsInstanceOfType <ApplicationRegistrationResult>(response.Data); Expect.AreEqual(ApplicationRegistrationStatus.Unauthorized, ((ApplicationRegistrationResult)response.Data).Status); }
public void OrganizationGetsCreated() { Log.Default = new ConsoleLogger(); Log.Default.StartLoggingThread(); string userName = 4.RandomLetters(); string orgName = 5.RandomLetters(); string appName = 8.RandomLetters(); ApplicationRegistrationService svc = GetTestServiceWithUser(userName); ProcessDescriptor descriptor = ProcessDescriptor.ForApplicationRegistration(svc.ApplicationRegistrationRepository, "localhost", 8080, appName, orgName); CoreServiceResponse response = svc.RegisterApplicationProcess(descriptor); Expect.IsTrue(response.Success); var user = svc.ApplicationRegistrationRepository.OneUserWhere(c => c.UserName == userName); user = svc.ApplicationRegistrationRepository.Retrieve <ApplicationRegistration.Data.User>(user.Id); Expect.IsNotNull(user); Expect.AreEqual(1, user.Organizations.Count); Thread.Sleep(1000); Pass($"{nameof(OrganizationGetsCreated)} Test Passed"); }