Ejemplo n.º 1
0
        public void Delete_Queue_Message()
        {
            IQueueOperations queueOperations = new QueueOperations();
            bool             result          = queueOperations.DeleteMessage(storageConnectionString, ConfigurationConstant.ComputQueueName, queueOperations.ReadMessage(storageConnectionString, ConfigurationConstant.ComputQueueName).Result).Result;

            Assert.True(result);
        }
Ejemplo n.º 2
0
        public void Read_Message_From_Compute_Queue()
        {
            string           outputName      = ConfigurationConstant.ComputQueueName;
            IQueueOperations queueOperations = new QueueOperations();
            string           queueMessage    = Convert.ToString(queueOperations.ReadMessage(storageConnectionString, ConfigurationConstant.ComputQueueName).Result.AsString);

            Assert.True(!string.IsNullOrEmpty(queueMessage));
        }
Ejemplo n.º 3
0
        public void Write_Big_Message_Length()
        {
            IQueueOperations queueOperations = new QueueOperations();
            string           message         = File.ReadAllText("./InputFiles/FixedDesign_Simulation_big.json");
            bool             result          = queueOperations.WriteMessage(storageConnectionString, ConfigurationConstant.OutputQueueName, message).Result;

            Assert.True(!result);
        }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations                       = new Operations(this);
     Skus                             = new SkusOperations(this);
     StorageAccounts                  = new StorageAccountsOperations(this);
     DeletedAccounts                  = new DeletedAccountsOperations(this);
     Usages                           = new UsagesOperations(this);
     ManagementPolicies               = new ManagementPoliciesOperations(this);
     BlobInventoryPolicies            = new BlobInventoryPoliciesOperations(this);
     PrivateEndpointConnections       = new PrivateEndpointConnectionsOperations(this);
     PrivateLinkResources             = new PrivateLinkResourcesOperations(this);
     ObjectReplicationPolicies        = new ObjectReplicationPoliciesOperations(this);
     LocalUsers                       = new LocalUsersOperations(this);
     EncryptionScopes                 = new EncryptionScopesOperations(this);
     BlobServices                     = new BlobServicesOperations(this);
     BlobContainers                   = new BlobContainersOperations(this);
     FileServices                     = new FileServicesOperations(this);
     FileShares                       = new FileSharesOperations(this);
     QueueServices                    = new QueueServicesOperations(this);
     Queue                            = new QueueOperations(this);
     TableServices                    = new TableServicesOperations(this);
     Table                            = new TableOperations(this);
     BaseUri                          = new System.Uri("https://management.azure.com");
     ApiVersion                       = "2021-08-01";
     AcceptLanguage                   = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Ejemplo n.º 5
0
        private static void Main(string[] args)

        {
            Console.WriteLine("=================================================================================================");
            Console.WriteLine("                                             WELCOME");
            Console.WriteLine("=================================================================================================");
            Console.WriteLine();

            bool running = true;

            while (running)
            {
                Console.WriteLine("                             ENTER 1 : TO INITIALIZE A QUEUE");
                Console.WriteLine("                             ENTER 2 : TO INITIALIZE A STACK");
                Console.WriteLine("                             ENTER 3 : TO INITIALIZE A LINKED-LIST");
                Console.WriteLine("                             ENTER 4 : TO EXIT");
                Console.WriteLine();

                string input = Console.ReadLine();

                switch (input)
                {
                case "1":
                    QueueOperations.Start();
                    break;

                case "2":
                    StackOperations.Start();
                    break;

                case "3":
                    LinkedListOperations.Start();
                    break;

                case "4":
                    Console.WriteLine("Good bye!");
                    running = false;
                    break;
                }
            }
        }
Ejemplo n.º 6
0
        public QueueController(QueueBrokersContext context)
        {
            db = context;
            if (qo == null)
            {
                qo = new QueueOperations(db);
            }

            //if (!db.QueueBrokers.Any())
            //{
            //    //test adding
            //    db.QueueBrokers.Add(new QueueBroker { Function_Name = "rr", Function_Parameter = "23" });

            //    db.SaveChanges();
            //} else
            //{
            //    //delete all committed
            //    var committedOperations = db.QueueBrokers.Where(w => w.Execution_Status == true);
            //    db.QueueBrokers.RemoveRange(committedOperations);
            //    db.SaveChanges();
            //}
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Preparing inputs for write message method from QueueOperations class and call.
        /// </summary>
        /// <param name="outputMessage">output message</param>
        /// <returns>if write message in queue successfully, it returns true.</returns>
        bool WriteMessage(string outputMessage)
        {
            IQueueOperations queueOperations = new QueueOperations();

            return(queueOperations.WriteMessage(storageConnectionString, ConfigurationConstant.OutputQueueName, outputMessage).Result);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Preparing inputs for read message method from QueueOperations class and call.
        /// </summary>
        /// <returns>Return read message as string</returns>
        CloudQueueMessage ReadMessage()
        {
            IQueueOperations queueOperations = new QueueOperations();

            return(queueOperations.ReadMessage(storageConnectionString, ConfigurationConstant.ComputQueueName).Result);
        }
Ejemplo n.º 9
0
        bool DeleteQueueMessage(CloudQueueMessage cloudQueueMessage)
        {
            IQueueOperations queueOperations = new QueueOperations();

            return(queueOperations.DeleteMessage(storageConnectionString, ConfigurationConstant.ComputQueueName, cloudQueueMessage).Result);
        }
Ejemplo n.º 10
0
 public QueuedQueueOperation(QueueOperations operation, Text codeLine = null)
 {
     Operation = operation;
     CodeLine  = codeLine;
 }
Ejemplo n.º 11
0
 public QueuedQueueOperation(QueueOperations operation, VehicleType type, Text codeLine = null)
 {
     Operation = operation;
     Type      = type;
     CodeLine  = codeLine;
 }