public async void ShouldSaveNewTicket()
        {
            var guestName    = Guid.NewGuid().ToString();
            var guestPhone   = "555-555-5555";
            var guestAddress = "12345 Somewhere USA";

            MockConsoleWrapper.SetupSequence(x => x.ReadLineAsync())
            .ReturnsAsync(guestName)
            .ReturnsAsync(guestPhone)
            .ReturnsAsync(guestAddress);

            IDictionary <string, string> actualConvertInputToModelArgument = null;

            MockConverter.Setup(x => x.ConvertInputToModel(It.IsAny <IDictionary <string, string> >()))
            .Callback <IDictionary <string, string> >(x => actualConvertInputToModelArgument = x);

            await Screen.Activated();

            var expectedConvertInputToModelArgument = new Dictionary <string, string>
            {
                { "Field 1", guestName },
                { "Field 2", guestPhone },
                { "Field 3", guestAddress }
            };

            Assert.Equal(expectedConvertInputToModelArgument, actualConvertInputToModelArgument);
        }
Exemplo n.º 2
0
 private void SetUpMenuSelectionThenQuit(string selection)
 {
     MockConsoleWrapper.SetupSequence(x => x.ReadLineAsync())
     .ReturnsAsync(selection)
     .ReturnsAsync("99");
 }