Exemple #1
0
        public void ValidNormalUserGetMailIncoming(MailIncomingTestData.Valid global)
        {
            var handler = new DefaultManager();
            var request = new Dictionary <string, object>();

            MailIncomingTestData.ValidIncomingMapperValue[global](request, MailIncomingTestData.Global, string.Empty);
            var response = handler.Send <object>(MailIncoming.IncomingConfiguration, request.ToDictionary(d => d.Key, d => d.Value.ToString()), HttpMethod.DELETE);

            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Can not delete mail incoming");
        }
        public void ValidGetMailIncomingAllow(MailIncomingTestData.Valid allowIncomingConfiguration)
        {
            var handler = new DefaultManager();
            var request = new Dictionary <string, object>();

            MailIncomingTestData.ValidIncomingMapperValue[allowIncomingConfiguration](request, MailIncomingTestData.AllowIncomingConfiguration, string.Empty);
            var response = handler.Send <object>(MailIncoming.IncomingConfigurationSpecific, request.ToJson(), HttpMethod.PUT);

            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.NoContent), "Can not get mail incoming allow");
        }
Exemple #3
0
        public void ValidCreateMailIncoming(MailIncomingTestData.Valid global, MailIncomingTestData.Valid server, MailIncomingTestData.Valid port, MailIncomingTestData.Valid ssl, MailIncomingTestData.Valid protocol, MailIncomingTestData.Valid acountName, MailIncomingTestData.Valid password, MailIncomingTestData.Valid fetchStart, MailIncomingTestData.Valid defaultSharing, MailIncomingTestData.Valid mailServer)
        {
            var handler = new DefaultManager();
            var request = new Dictionary <string, object>();

            MailIncomingTestData.ValidIncomingMapperValue[global](request, MailIncomingTestData.Global, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[server](request, MailIncomingTestData.Server, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[port](request, MailIncomingTestData.Port, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[ssl](request, MailIncomingTestData.Ssl, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[protocol](request, MailIncomingTestData.Protocol, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[acountName](request, MailIncomingTestData.AccountName, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[password](request, MailIncomingTestData.Password, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[fetchStart](request, MailIncomingTestData.FetchStart, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[defaultSharing](request, MailIncomingTestData.DefaultSharing, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[mailServer](request, MailIncomingTestData.MailServerId, string.Empty);//TODO prepare mail serverId
            var response = handler.Send <object>(MailIncoming.IncomingConfiguration, request.ToJson(), HttpMethod.POST);

            PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.NoContent), "Can not get mails");
        }
Exemple #4
0
        public void InvalidCreateMailIncoming(MailIncomingTestData.Valid global, MailIncomingTestData.Invalid invalid, string param)
        {
            var handler = new DefaultManager();
            var request = new Dictionary <string, object>();

            MailIncomingTestData.ValidIncomingMapperValue[global](request, MailIncomingTestData.Global, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.Porters](request, MailIncomingTestData.Server, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.POP3Port](request, MailIncomingTestData.Port, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.Zero](request, MailIncomingTestData.Ssl, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.POP3Protocol](request, MailIncomingTestData.Protocol, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.ValidAccount](request, MailIncomingTestData.AccountName, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.ValidPassword](request, MailIncomingTestData.Password, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.Zero](request, MailIncomingTestData.FetchStart, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.Zero](request, MailIncomingTestData.DefaultSharing, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[MailIncomingTestData.Valid.ValidMailServer](request, MailIncomingTestData.MailServerId, string.Empty);
            MailIncomingTestData.InvalidIncomingMapperValue[invalid](request, param);
            var response = handler.Send <object>(MailIncoming.IncomingConfiguration, request.ToJson(), HttpMethod.POST);

            PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest), "Can not get mails");
        }
Exemple #5
0
        private static void GetMailIncomingAndVerify(MailIncomingTestData.Valid allowUserSpecific, MailIncomingTestData.Valid global, MailIncomingTestData.Valid fullConfig, bool isSuccess, DefaultManager handler)
        {
            var requestAllow = new Dictionary <string, object>();

            MailIncomingTestData.ValidIncomingMapperValue[allowUserSpecific](requestAllow, MailIncomingTestData.AllowIncomingConfiguration, string.Empty);
            var responseAllow = handler.Send <object>(MailIncoming.IncomingConfigurationAllow, requestAllow.ToJson(), HttpMethod.PUT);

            PrAssume.That(responseAllow, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.NoContent), "Can not get mail incoming allow");
            var request = new Dictionary <string, object>();

            MailIncomingTestData.ValidIncomingMapperValue[global](request, MailIncomingTestData.Global, string.Empty);
            MailIncomingTestData.ValidIncomingMapperValue[fullConfig](request, MailIncomingTestData.FullConfig, string.Empty);
            var response = handler.Send <object>(MailIncoming.IncomingConfiguration, request.ToDictionary(d => d.Key, d => d.Value.ToString()), HttpMethod.GET);

            if (isSuccess)
            {
                PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Can not get mail incoming");
            }
            else
            {
                PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.Forbidden), "Can not get mail incoming");
            }
        }
Exemple #6
0
        public void ValidAdminUserGetMailIncoming(MailIncomingTestData.Valid allowUserSpecific, MailIncomingTestData.Valid global, MailIncomingTestData.Valid fullConfig, bool isSuccess)
        {
            var handler = new DefaultManager();

            GetMailIncomingAndVerify(allowUserSpecific, global, fullConfig, isSuccess, handler);
        }
Exemple #7
0
        public void ValidNormalUserGetMailIncoming(MailIncomingTestData.Valid allowUserSpecific, MailIncomingTestData.Valid global, MailIncomingTestData.Valid fullConfig, bool isSuccess)
        {
            var handler = new DefaultManager(PreparedConnection.Data);

            GetMailIncomingAndVerify(allowUserSpecific, global, fullConfig, isSuccess, handler);
        }