public async Task Handle_StateUnderTest_ExpectedBehavior() { // Arrange var unitUnderTest = this.CreateAddNasabByAdminCommandHandler(); AddNasabCommand request = new AddNasabCommand() { PersonNames = new string[] { "Afandy", "Lamusu" }, FatherId = Guid.NewGuid() }; CancellationToken cancellationToken = CancellationToken.None; var contact = new Contact(request.PersonId, request.PersonNames); this.mockMediator.Setup(x => x.Send(It.IsAny <IRequest <Contact> >(), cancellationToken)).Returns(Task.FromResult(contact)); this.mockNasabRepository.Setup(x => x.Update(It.IsAny <PeopleNasab>())).Returns(Task.CompletedTask); // Act var result = await unitUnderTest.Handle( request, cancellationToken); // Assert result.Should().NotBeNull(); }
internal void Map(out AddNasabCommand command) { command = new AddNasabCommand { FatherId = FatherId, KabilahId = KabilahId, PersonNames = new string[] { FirstName, LastName } }; }