Example #1
0
        public async Task AddNoteTest()
        {
            var note   = UnityConfiguration.Container.Resolve <INote>();
            var sut    = new AddNoteCommand.Handler(note);
            var result = await sut.Handle(new AddNoteCommand.Request()
            {
                Text = "texto de prueba"
            }, default);

            Assert.AreEqual(true, result);
        }
Example #2
0
        public async Task ListNoteTest()
        {
            var note = UnityConfiguration.Container.Resolve <INote>();

            var add       = new AddNoteCommand.Handler(note);
            var resultAdd = await add.Handle(new AddNoteCommand.Request()
            {
                Text = "texto de prueba"
            }, default);

            Assert.AreEqual(true, resultAdd);

            var sut    = new ListNotesQuery.Handler(note);
            var result = await sut.Handle(new ListNotesQuery.Request()
            {
            }, default);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.FirstOrDefault().Text, "texto de prueba");
        }