Example #1
0
        public HostMainMenu(ReturnHostModel host, List <EventModel> sHost)
        {
            var vm = new HostMainMenuViewModel(host, sHost);

            vm.Navigation  = Navigation;
            BindingContext = vm;

            InitializeComponent();
        }
Example #2
0
        public HostMainMenuViewModel(ReturnHostModel hostModel, List <EventModel> events)
        {
            _selectedEvent = null;

            if (hostModel != null)
            {
                _host = new Host(hostModel);
            }
            else
            {
                _host      = new Host();
                _host.Name = "Troels Bleicken";
            }
            _events = new ObservableCollection <EventModel>(events);
        }
Example #3
0
        public async Task TestReturnHost()
        {
            string toParse =
                "{\n\t\"Name\":\"testName\",\n\t\"Email\":\"testEmail\",\n\t\"Events\":[\n\t\t{\n\t\t\t\"Location\":\"testLocation\",\n\t\t\t\"Description\":\"testDescription\",\n\t\t\t\"Name\":\"testName\",\n\t\t\t\"StartDate\":\"2019-05-20T12:00:00\",\n\t\t\t\"EndDate\":\"2019-05-20T12:00:00\",\n\t\t\t\"Pin\":\"1234\"\n\t\t}\n\t\t]\n}";
            HttpResponseMessage msg = new HttpResponseMessage
            {
                Content = new StringContent(toParse)
            };

            ReturnHostModel testHost = await uut.DeserializedData <ReturnHostModel>(msg);

            Assert.That(testHost.Email.Contains("testEmail") &&
                        testHost.Name.Contains("testName") &&
                        testHost.Events.ToList().Count == 1);
        }
Example #4
0
 public Host(ReturnHostModel rm)
 {
     Email = rm.Email;
     Name  = rm.Name;
 }