Exemplo n.º 1
0
        public async void GetContactByIdQueryTest()
        {
            //Arange
            var testHelper = new TestHelper();

            var contact = Contact.Create("someone", "*****@*****.**", "156464654", null, testHelper.contactsContext);

            await testHelper.contactsContext.AddAsync(contact);

            await testHelper.contactsContext.SaveChangesAsync();

            GetContactByIdQuery        query   = new GetContactByIdQuery(contact.Id);
            GetContactByIdQueryHandler handler = new GetContactByIdQueryHandler(testHelper.contactsContext);

            //Act
            var result = await handler.Handle(query, default);

            //Asert
            result.Should().NotBeNull();
            result.FullName.Should().Be("someone");
        }