コード例 #1
0
        public void GetItemsThrowIfNoOutput()
        {
            GetItemsOutput mockOutput   = null;
            var            mockResponse = CreateJobResponse(mockOutput);

            var client = new MyRpaClient(GetMockOrchestratorClient(mockResponse), _validSetting);

            Assert.Throws <ArgumentNullException>(() => client.GetItemsAsync(new GetItemsInput()).GetAwaiter().GetResult());
        }
コード例 #2
0
        public void GetItemsSuccess()
        {
            var mockOutput = new GetItemsOutputInternal()
            {
                DeliveryDate = new string[]
                {
                    DateTime.Today.AddDays(2).ToShortDateString(),
                    DateTime.Today.AddDays(10).ToShortDateString()
                },
                ItemId         = new string[] { "1234", "5678" },
                OrderId        = new string[] { "7890", "1357" },
                ItemName       = new string[] { "Name1", "Name2" },
                Quantity       = new string[] { "1", "2" },
                DeliveryStatus = new string[] { "out of stock", "delivered" },
            };

            var mockResponse = CreateJobResponse(mockOutput);

            var client = new MyRpaClient(GetMockOrchestratorClient(mockResponse), _validSetting);
            var output = client.GetItemsAsync(new GetItemsInput()).GetAwaiter().GetResult();

            Assert.Equal(mockOutput.ItemId.Length, output.Items.Length);
            Assert.Equal(mockOutput.ItemId[0], output.Items[0].ItemId);
        }