public void LogOn_Logged_Test()
        {
            string token = "mytoken";

            IRegisteredUserRepository eventDefinitionService = new StubIRegisteredUserRepository()
            {
                AddRegisteredUser = (user) =>
                    {
                        Assert.AreEqual(user.FacebookId, "facebookId");
                        return 10;
                    }
            };
            IFacebookService facebookService = new StubIFacebookService()
            {
                GetUserInformationString = (facebookToken) =>
                    {
                        return new Model.RegisteredUser() { FacebookId = "facebookId" };
                    }
            };
            var target = new AuthenticationController(eventDefinitionService, facebookService);

            MyEvents.Api.Authentication.AuthenticationResponse response = target.LogOn(token);

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Token);
        }
        public void LogOn_TokenException_Test()
        {
            IRegisteredUserRepository eventDefinitionService = new StubIRegisteredUserRepository();
            IFacebookService facebookService = new StubIFacebookService();
            var target = new AuthenticationController(eventDefinitionService, facebookService);

            target.LogOn(string.Empty);
        }
        public void LogOn_TokenNotValid_Test()
        {
            string token = "mytoken";

            IRegisteredUserRepository eventDefinitionService = new StubIRegisteredUserRepository()
            {
                GetString = (facebookId) =>
                {
                    Assert.Fail();
                    return null;
                }
            };
            IFacebookService facebookService = new StubIFacebookService()
            {
                GetUserInformationString = (facebookToken) =>
                {
                    return null;
                }
            };
            var target = new AuthenticationController(eventDefinitionService, facebookService);

            MyEvents.Api.Authentication.AuthenticationResponse response = target.LogOn(token);

            Assert.IsNull(response);
        }