예제 #1
0
        public void RegisterUserRegisters()
        {
            MockedDummyRegisterService _mockedDummy = new MockedDummyRegisterService();

            _mockedDummy.error = false;
            IRegister _regView = new mov4eRegistration(new Mov4e.View.LogInView.mov4eLogin())
            {
                Age       = 10,
                UserName  = "******",
                FirstName = "Lucher",
                LastName  = "Nikolow",
                Password  = "******",
                Email     = "*****@*****.**",
                Gender    = "M"
            };
            IRegisterPresenter _registerPresenter = new RegisterPresenter(_regView, _mockedDummy._registerService);

            _registerPresenter.RegisterUser();

            Assert.AreEqual(10, _mockedDummy._userinfo.age);
            Assert.AreEqual("Lucher", _mockedDummy._userinfo.firstName);
            Assert.AreEqual("Nikolow", _mockedDummy._userinfo.lastName);
            Assert.AreEqual("*****@*****.**", _mockedDummy._userinfo.email);
            Assert.AreEqual("M", _mockedDummy._userinfo.gender);
            Assert.AreEqual("asdasd", _mockedDummy._user.password);
            Assert.AreEqual("WolF", _mockedDummy._user.userName);
        }
예제 #2
0
        public void RegisterUserThrowsException()
        {
            MockedDummyRegisterService _mockedDummy = new MockedDummyRegisterService();
            IRegister _regView = new mov4eRegistration(new Mov4e.View.LogInView.mov4eLogin())
            {
                Age       = 10,
                UserName  = "******",
                FirstName = "Lucher",
                LastName  = "Nikolow",
                Password  = "******",
                Email     = "*****@*****.**",
                Gender    = "M"
            };
            IRegisterPresenter _registerPresenter = new RegisterPresenter(_regView, _mockedDummy._registerService);

            Assert.AreEqual(false, _registerPresenter.RegisterUser());
        }