예제 #1
0
        public async Task Should_Modify_User()
        {
            // Arrange
            User user = FakeUsers.Performer;

            _userAccessor.GetCurrentUserAsync().Returns(user);
            _mapper.Map(Arg.Any <Modify.Command>(), Arg.Any <User>()).Returns(user);

            // Act
            Unit result = await _handler.Handle(new Modify.Command(), new CancellationToken());

            // Assert
            result.Should().Be(Unit.Value);
        }
예제 #2
0
        public async Task Should_Modify()
        {
            // Arrange
            Appointment expectedAppointment = AppointmentSeedData.RockingXMasConcert;

            _arpaContext.FindAsync <Appointment>(Arg.Any <object[]>(), Arg.Any <CancellationToken>())
            .Returns(expectedAppointment);
            _arpaContext.SaveChangesAsync(Arg.Any <CancellationToken>())
            .Returns(1);

            // Act
            Unit result = await _handler.Handle(new Logic.Appointments.Modify.Command(), new CancellationToken());

            // Assert
            result.Should().BeEquivalentTo(Unit.Value);
        }