public void CanGetAllCategories()
        {
            // ARRANGE
            var expectedCategoryDtos = Substitute.For <IList <CategoryDto> >();

            _noteTaker.ListCategories(Arg.Any <SecurityContext>()).Returns(expectedCategoryDtos);

            // ACT
            var result = _subjectUnderTest.Get();

            // ASSERT
            Assert.That(result, Is.Not.Null);
            _noteTaker.Received(1).ListCategories(Arg.Any <SecurityContext>());
        }
Beispiel #2
0
        public IActionResult Get()
        {
            var categoryDtos = _noteTaker.ListCategories(SecurityContext);

            return(Ok(categoryDtos));
        }