public void TestSubmitMagic()
        {
            // no arguments
            var azureClient = new MockAzureClient();
            var submitMagic = new SubmitMagic(azureClient);

            submitMagic.Test(string.Empty);
            Assert.AreEqual(AzureClientAction.SubmitJob, azureClient.LastAction);

            // single argument
            submitMagic.Test($"{operationName}");
            Assert.AreEqual(AzureClientAction.SubmitJob, azureClient.LastAction);
            Assert.IsTrue(azureClient.SubmittedJobs.Contains(operationName));
        }
Exemple #2
0
        public void TestSubmitMagic()
        {
            // no arguments
            var azureClient = new MockAzureClient();
            var submitMagic = new SubmitMagic(azureClient, new UnitTestLogger <SubmitMagic>());

            submitMagic.Test(string.Empty);
            Assert.AreEqual(AzureClientAction.SubmitJob, azureClient.LastAction);

            // single argument
            submitMagic.Test($"{operationName}");
            Assert.AreEqual(AzureClientAction.SubmitJob, azureClient.LastAction);
            Assert.IsTrue(azureClient.SubmittedJobs.Contains(operationName));

            // jobParams argument
            Assert.IsTrue(azureClient.JobParams.IsEmpty);
            submitMagic.Test($"{operationName} jobParams={jobParams}");
            Assert.IsTrue(azureClient.JobParams.TryGetValue(jobParamsKey1, out string value1));
            Assert.AreEqual(value1, jobParamsVal1);
            Assert.IsTrue(azureClient.JobParams.TryGetValue(jobParamsKey2, out string value2));
            Assert.AreEqual(value2, jobParamsVal2);
        }