Exemple #1
0
        public NoticeEmailTests()
        {
            var dir = AppDomain.CurrentDomain.BaseDirectory;

            _emailTemplate = "EmailTemplate.html";

            _testOptions = Options.Create <NoticeEmailOptions> (
                new NoticeEmailOptions
            {
                EmailTemplateFolder = Path.Combine(dir, @"..\..\..\IntegrationTests"),
                EmailArchiveFolder  = Path.Combine(dir, @"..\..\..\\IntegrationTests\EmailArchiveFolder"),
                EmailSenderAddress  = "*****@*****.**",
                EmailSenderName     = "Email Return",
                SmtpHost            = "127.0.0.1",
                SmtpPort            = 0
            });

            var noticeStorageOptions = Options.Create <NoticeStorageOptions>(
                new NoticeStorageOptions {
                ConnectionString = "UseDevelopmentStorage=true",
                ApplicationName  = "notice"
            });

            _noticeStorageService = new NoticeStorageService(noticeStorageOptions, null);
        }
Exemple #2
0
        public async Task CanStoreARecord()
        {
            var        cut         = new NoticeStorageService(_options, null);
            FileStream inputStream = new FileStream(_filePath, FileMode.Open);
            await cut.UploadFileFromStream("NoticeStorageServiceTestFile.txt", inputStream);

            inputStream.Close();
        }
Exemple #3
0
        public NoticeAsAttachmentNoticeProviderTests()
        {
            var noticeStorageOptions = Options.Create <NoticeStorageOptions>(
                new NoticeStorageOptions {
                ConnectionString = "UseDevelopmentStorage=true",
                ApplicationName  = "notice"
            });

            _noticeStorageService = new NoticeStorageService(noticeStorageOptions, null);
            _documentService      = new NoticeDocumentService(null, new FileSystem(), _noticeStorageService, GetDocumentOptions());
            _emailService         = new NoticeEmail(GetEmailOptions(), null, _noticeStorageService, new FileSystem());
        }
        public DocumentServiceTests()
        {
            var dir = AppDomain.CurrentDomain.BaseDirectory;

            _templateDirectory        = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\..\IntegrationTests");
            _documentArchiveDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\..\IntegrationTests\ArchiveFolder");
            _principalInformation     = new ProcessingInformation
            {
                DocumentTemplate = "PaidSickLeave-MandatoryNotice-English.pdf",
                FormParameters   = new Dictionary <string, string>
                {
                    { "Start of Calendar Year", "2019-01-01" },
                    { "End of Calendar Year", "2019-12-31" }
                }
            };
            var noticeStorageOptions = Options.Create <NoticeStorageOptions> (
                new NoticeStorageOptions
            {
                ConnectionString = "UseDevelopmentStorage=true",
                ApplicationName  = "notice"
            });

            _noticeStorageService = new NoticeStorageService(noticeStorageOptions, null);
        }
Exemple #5
0
        // Connect to the Azure Cosmos DB Emulator running locally
        // DocumentClient client = new DocumentClient(
        //     new Uri("https://localhost:8081"),
        //     "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==");

        public DCNoticeProviderTests()
        {
            // EndpointUrl;
            // _authorizationKey = options.Value.AuthorizationKey;
            // _databaseId = options.Value.DatabaseId;
            // _collectionId = options.Value.CollectionId;


            var noticeStorageOptions = Options.Create <NoticeStorageOptions> (
                new NoticeStorageOptions
            {
                ConnectionString = "UseDevelopmentStorage=true",
                ApplicationName  = "notice",
                EndpointUrl      = "https://localhost:8081",
                AuthorizationKey = "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
                DatabaseId       = "Notices",
                CollectionId     = "NoticeRecords"
            });

            _noticeStorageService = new NoticeStorageService(noticeStorageOptions, null);

            _documentService = new NoticeDocumentService(null, new FileSystem(), _noticeStorageService, GetDocumentOptions());
            _emailService    = new NoticeEmail(GetEmailOptions(), null, _noticeStorageService, new FileSystem());
        }