Beispiel #1
0
        public async Task PostCreateLootAsync_ShouldCreateLoot_ThenReturnLootResponse()
        {
            const int groupId           = 8;
            var       createLootRequest = new CreateLootRequest();
            var       createdLoot       = new Loot();
            var       lootResponse      = new LootResponse();

            _lootService.CreateLootAsync(_executionContext, groupId, createLootRequest)
            .Returns(createdLoot);
            _mapper.Map <LootResponse>(createdLoot)
            .Returns(lootResponse);

            var result = await _controller.PostCreateLootAsync(_executionContext, groupId, createLootRequest);

            result.Value.Should().BeSameAs(lootResponse);
            result.StatusCode.Should().Be(StatusCodes.Status201Created);
        }