Beispiel #1
0
        private static void InitialGetNote(ISqlCommand <List <GetNotesOutput>, Guid> getNoteCommand)
        {
            getNoteCommand.ExecuteAsync(Arg.Is <Guid>(p => p == new Guid("6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1")))
            .Returns(new List <GetNotesOutput>()
            {
                new GetNotesOutput()
                {
                    Notekey           = 1,
                    AccountIdentifier = "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1",
                    CareAgentName     = "Gorden James",
                    ChangeBy          = "Test1",
                    CreateDate        = DateTime.MaxValue,
                    Note = "Note 1"
                },
                new GetNotesOutput()
                {
                    Notekey           = 2,
                    AccountIdentifier = "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2",
                    ChangeBy          = "Test2",
                    CreateDate        = DateTime.MaxValue,
                    Note = "Note 2"
                },
            });
            getNoteCommand.ExecuteAsync(Arg.Is <Guid>(p => p == new Guid("6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2")))
            .Returns(new List <GetNotesOutput>()
            {
                new GetNotesOutput()
                {
                    Notekey           = 2,
                    AccountIdentifier = "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2",
                    ChangeBy          = "Test2",
                    CreateDate        = DateTime.MaxValue,
                    Note = "Note 2"
                },
            });

            getNoteCommand.ExecuteAsync(
                Arg.Is <Guid>(p => p == new Guid("6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC3")))
            .Returns((List <GetNotesOutput>)null);

            getNoteCommand.When(
                m =>
                m.ExecuteAsync(Arg.Is <Guid>(p => p == new Guid("6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC4"))))
            .Do(
                x =>
            {
                throw new GdErrorException(
                    "Error while executing GetNotes 6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC4");
            });

            getNoteCommand.When(
                m =>
                m.ExecuteAsync(Arg.Is <Guid>(p => p == new Guid("6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC5"))))
            .Do(
                x => { throw new Exception("Error while executing GetNotes 6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC5"); });
        }