Ejemplo n.º 1
0
            public void VoidRecordedService_Success()
            {
                Mock <IVoidServiceRuleEngine> mock = new Mock <IVoidServiceRuleEngine>();

                voidServiceRuleEngine = mock.Object;
                VoidServiceController voidServiceController = new VoidServiceController(voidServiceRuleEngine);
                var voidServiceModel = new VoidServiceModel
                {
                    ServiceRecordingID           = 1,
                    ServiceRecordingVoidReasonID = 1,
                    IncorrectOrganization        = true,
                    IncorrectServiceType         = true,
                    IncorrectServiceItem         = true,
                    IncorrectServiceStatus       = true,
                    IncorrectSupervisor          = true,
                    IncorrectAdditionalUser      = true,
                    IncorrectAttendanceStatus    = true,
                    IncorrectStartDate           = true,
                    IncorrectStartTime           = true,
                    IncorrectEndDate             = true,
                    IncorrectEndTime             = true,
                    IncorrectDeliveryMethod      = true,
                    IncorrectServiceLocation     = true,
                    IncorrectRecipientCode       = true,
                    IncorrectTrackingField       = true,
                    Comments   = "",
                    ModifiedOn = DateTime.Now
                };
                //Act
                var saveResult = voidServiceController.VoidRecordedService(voidServiceModel);
                var response   = saveResult as HttpResult <Response <VoidServiceModel> >;
                var count      = response.Value.DataItems.Count();

                //Assert
                Assert.IsNotNull(voidServiceModel);
                Assert.IsTrue(count > 0);
            }
 /// <summary>
 /// Initializes a new instance of the <see cref="VoidServiceController"/> class.
 /// </summary>
 /// <param name="voidServiceRuleEngine">The voidService engine.</param>
 public VoidServiceController(IVoidServiceRuleEngine voidServiceRuleEngine)
 {
     this.voidServiceRuleEngine = voidServiceRuleEngine;
 }