Beispiel #1
0
        public async Task ShouldGetLanguage()
        {
            // Arrange
            var getLanguageCommand = new GetLanguageCommand(2);

            // Act
            var result = await _getLanguageQueryHandler.Handle(getLanguageCommand);

            // Assert
            Assert.IsNotNull(result?.Object);
        }
Beispiel #2
0
        public async Task Language_GetQuery_Success()
        {
            //Arrange
            GetLanguageQuery query = new GetLanguageQuery();

            _languageRepository.Setup(x => x.GetAsync(It.IsAny <Expression <Func <Language, bool> > >()))
            .ReturnsAsync(new Language()
//propertyler buraya yazılacak
//{
//LanguageId = 1,
//LanguageName = "Test"
//}
                          );

            GetLanguageQueryHandler handler = new GetLanguageQueryHandler(_languageRepository.Object, _mediator.Object);

            //Act
            var x = await handler.Handle(query, new System.Threading.CancellationToken());

            //Asset
            Assert.That(x.Success, Is.True);
            //Assert.That(x.Data.LanguageId, Is.EqualTo(1));
        }
        public async Task Language_GetQuery_Success()
        {
            // Arrange
            var query = new GetLanguageQuery();

            _languageRepository.Setup(x => x.GetAsync(It.IsAny <Expression <Func <Language, bool> > >()))
            .ReturnsAsync(new Language());
// propertyler buraya yazılacak
// {
// LanguageId = 1,
// LanguageName = "Test"
// }


            var handler = new GetLanguageQueryHandler(_languageRepository.Object, _mediator.Object);

            // Act
            var x = await handler.Handle(query, new CancellationToken());

            // Asset
            x.Success.Should().BeTrue();
            // x.Data.Id.Should().Be(1);
        }