Esempio n. 1
0
        public void TestPost()
        {
            _testScenarioSupport.LoadTestScenario("jacks-test-scenario");

            var userDataGateway    = new UserDataGateway(new DatabaseTemplate(_dataSourceConfig));
            var accountDataGateway = new AccountDataGateway(new DatabaseTemplate(_dataSourceConfig));
            var service            = new RegistrationService(userDataGateway, accountDataGateway);

            var controller = new RegisationController(service);
            var value      = controller.Post(new UserInfo(-1, "aUser", ""));
            var actual     = (UserInfo)((ObjectResult)value).Value;

            Assert.True(actual.Id > 0);
            Assert.Equal("aUser", actual.Name);
            Assert.Equal("registration info", actual.Info);
        }
 public RegistrationControllerTest()
 {
     _service    = new Mock <IRegistrationService>();
     _controller = new RegisationController(_service.Object);
 }