Beispiel #1
0
        public async Task LoginAsExistingHostSucceeds()
        {
            Host testHost = new Host
            {
                Email    = "*****@*****.**",
                Password = "******"
            };

            Assert.That(await uut.SendDataReturnIsValid(testHost, DataType.Host), Is.True);
        }
Beispiel #2
0
        private async void Login_Execute()
        {
            // Denne metode skal der hentes bruger data fra serveren
            // Den bruger data der hentes, skal sendes videre til næste view. Som er HostMenu.
            // Brugeren hente ned og bruger data tilføres et bruger objekt.

            IServerDataHandler  handler = new ServerDataHandler();
            IServerCommunicator Com     = new ServerCommunicator(handler);

            if (await Com.SendDataReturnIsValid(Host, DataType.Host))
            {
                IFromJSONParser Parser = new FromJsonParser();

                var ServerHost = await Parser.DeserializedData <ReturnHostModel>(handler.LatestMessage);

                var rootPage = Navigation.NavigationStack.FirstOrDefault();
                if (rootPage != null)
                {
                    var page = (ServerHost.Events != null)
                        ? new HostMainMenu(ServerHost, ServerHost.Events.ToList())
                        : new HostMainMenu(ServerHost);

                    _memoryManager.SaveCookie(handler.LatestReceivedCookies, ServerHost.Name);

                    Navigation.InsertPageBefore(page, Navigation.NavigationStack.First());
                    await Navigation.PopToRootAsync();
                }
            }
        }