public void NotifyUserOnRegistration_Integration_EmailSent()
        {
            using (var fixture = new FixtureInit("http://localhost"))
            {
                // assert
                var credentialsRepository = new CredentialsRepository(fixture.Setup.Context);
                var credentialService = new CredentialsService(credentialsRepository);
                var emailService = new EmailService(credentialService);
                var notificationService = new NotificationService(emailService);

                // act / assert
                notificationService.NotifyUserOnRegistration("*****@*****.**", "password");
            }
        }
        public void Credentials_GetCredentials()
        {
            using (var fixture = new FixtureInit("http://localhost"))
            {
                // arrange 
                var repository = new CredentialsRepository(fixture.Setup.Context);

                // act
                var credentials = repository.Credentials;

                // assert
                Assert.That(credentials, Is.Not.Null);
                Assert.That(credentials.Count(), Is.EqualTo(0), "No credentials set in initial database.");
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Trackyt.net - upgrade for v.1.0.1.\nNotify all users about password remove.\n");

            try
            {
                // repositories
                var usersRepository = new UsersRepository();
                var credentialsRepository = new CredentialsRepository();

                // services
                var credentialService = new CredentialsService(credentialsRepository);
                var emailService = new EmailService(credentialService);

                SendEmailNotificationsToUsers(usersRepository, emailService);
            }
            catch (Exception e)
            {
                Console.WriteLine("User notification failed!");
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }