Example #1
0
        public async Task UploadAsync_AddAsyncToAudioLocalRepositoryIsCalled_True()
        {
            var audioLocalRepoMock = Substitute.For <IAudioLocalRepository>();
            var sut = new AudioServiceBuilder()
                      .WithLocalRepo(audioLocalRepoMock)
                      .Build();

            var audio = new AudioUploadDtoBuilder().Build();

            await sut.UploadAudioAsync(audio, CancellationToken.None);

            await audioLocalRepoMock.Received().AddAsync(Arg.Any <AudioUploadDto>(), CancellationToken.None);
        }
Example #2
0
        public async Task UploadAsync_SaveAsyncToAudioEntriesRepositoryIsCalled_True()
        {
            var audioRepoMock = Substitute.For <IAudioEntriesRepository>();

            var sut = new AudioServiceBuilder()
                      .WithAudioEntriesRepo(audioRepoMock)
                      .Build();

            var audio = new AudioUploadDtoBuilder().Build();

            await sut.UploadAudioAsync(audio, CancellationToken.None);

            await audioRepoMock.Received().SaveAsync(CancellationToken.None);
        }