Пример #1
0
        public async Task Should_Invoke_AllFormats_Once()
        {
            // Arrange
            _formatRepository.AllFormats().Returns(new List <Format>());

            // Act
            await _sut.AllFormats();

            // Assert
            await _formatRepository.Received(1).AllFormats();
        }
Пример #2
0
        public async Task Given_A_YugiohBanlist_Should_Invoke_FormatByAcronym_Method_Once()
        {
            // Arrange
            const int expected      = 1;
            var       yugiohBanlist = new YugiohBanlist();

            _formatRepository.FormatByAcronym(Arg.Any <string>()).Returns(new Format());
            _banlistRepository.Add(Arg.Any <Banlist>()).Returns(new Banlist());

            // Act
            await _sut.Add(yugiohBanlist);

            // Assert
            await _formatRepository.Received(expected).FormatByAcronym(Arg.Any <string>());
        }