public async Task ShouldCreateAnnouncementProperly()
        {
            //Arrange
            var tag     = "tag";
            var tagList = new List <string>
            {
                tag
            };
            var repository   = new Mock <IAnnouncementsRepository>();
            var announcement = new Announcement(new Guid(), new Guid(), string.Empty, string.Empty, string.Empty, new List <string>(),
                                                new List <string>());

            repository.Setup(x => x.AddAsync(It.IsAny <Announcement>()))
            .Callback <Announcement>(x => announcement = x)
            .Returns(Task.CompletedTask);

            var createNewAnnouncementHandler = new CreateNewAnnouncementHandler(repository.Object);
            var command = new CreateNewAnnouncementCommand(new Guid(), new Guid(), "test", "test", "test",
                                                           new List <string>(), tagList);

            //Act
            await createNewAnnouncementHandler.HandleAsync(command);

            //Assert
            repository.Verify(x => x.AddAsync(It.IsAny <Announcement>()), Times.Once);
            Assert.That(announcement.Description, Is.EqualTo((command.Description)));
            Assert.That(announcement.ShortDescription, Is.EqualTo(command.ShortDescription));
            Assert.That(announcement.Tags.Any(x => x.Contains(tag)), Is.True);
        }
        public async Task <IActionResult> CreateNewAnnouncementAsync([FromBody] CreateNewAnnouncementRequest request)
        {
            var team = queryBus.Execute(new GetTeamByIdQuery(request.TeamId)).Team;

            if (team == null)
            {
                //should throw exception, but adding announcement without teamId is possible -> every logged in user should can add announcements etc
                //TODO -> add announcement without team (then team will be possible to set in update) OR return exception, with information about bad team id
            }

            var command = new CreateNewAnnouncementCommand(AuthorizedUser.Id, request.TeamId, request.Title, request.ShortDescription,
                                                           request.Description, request.Requirements, request.Tags);
            await commandBus.ExecuteAsync(command);

            return(Ok());
        }