Esempio n. 1
0
        public async Task RegisterCommonUserTest()
        {
            SetupServices();
            var MockRequest = new Mock <RegisterCommonUserRequest>();

            MockRequest.Object.Name               = new RSCD.Model.Custom.Name();
            MockRequest.Object.Password           = "******";
            MockRequest.Object.PhoneNumber        = "abc123";
            MockRequest.Object.GovernmentIdNumber = "";
            MockRequest.Object.GovernmentIdType   = "";
            MockRequest.Object.IsVolunteering     = true;
            MockRequest.Object.VolunteeringField  = "";

            ActionResponse res = new ActionResponse(StatusCodes.Status200OK);

            var registrationController = new RegistrationController(ServiceProvider.GetRequiredService <Registration_BL>());
            //Act
            var result = await(registrationController.RegisterCommonUser(MockRequest.Object)) as ObjectResult;

            //Assert
            Assert.Equal(res.StatusCode, result.StatusCode);
        }