public void ShouldMapPointsRedeemPlanToPointsRedeemPlanDto() { var entity = new PointsRedeemPlan(); var result = _mapper.Map <PointsRedeemPlanDto>(entity); result.ShouldNotBeNull(); result.ShouldBeOfType <PointsRedeemPlanDto>(); }
public async Task Handle_ValidCommand_ShouldSaveEntriesSuccessfully(PointsRedeemPlan pointsRedeemPlan) { // Arrange _mapperMock.Setup(m => m.Map <PointsRedeemPlan>(It.IsAny <CreatePointsRedeemPlanCommand>())) .Returns(pointsRedeemPlan); // AutoMapper setup var sut = new CreatePointsRedeemPlanCommandHandler(_context, _mapperMock.Object); // creating system under test // Act await sut.Handle(new CreatePointsRedeemPlanCommand(), CancellationToken.None); // Assert _context.PointsRedeemPlans.Count().ShouldBe(1); }