Exemplo n.º 1
0
        public async Task Given_An_AllFormats_Query_Should_Invoke_AllFormats_Method_Once()
        {
            // Arrange
            const int expected = 1;

            _formatService.AllFormats().Returns(new List <Format> {
                new Format
                {
                    Id      = 2342,
                    Name    = "Test Format",
                    Acronym = "TF",
                    Banlist = new List <Banlist>()
                },
                new Format
                {
                    Id      = 23424,
                    Name    = "Test Format 2",
                    Acronym = "TF",
                    Banlist = new List <Banlist>()
                }
            });

            // Act
            await _sut.Handle(new AllFormatsQuery(), CancellationToken.None);

            // Assert
            await _formatService.Received(expected).AllFormats();
        }