public void DeserializeObjectToForm_Null_ReturnFalse()
        {
            frindle dummy = new frindle();
            dummy.Name = "Waldo";
            dummy.Whut = "Navy SEAL";

            FormViewModel form = new FormViewModel();
            form.AddField(new TestFormField("Name", "Name:", "Enter a name."));
            form.AddField(new TestFormField("Whut", "Whut?:", "Enter schtuff."));

            Assert.IsFalse(form.DeserializeObjectToForm(null));
        }
        public void DeserializeObjectToForm_EmptyObject_EmptyForm()
        {
            frindle dummy = new frindle();

            FormViewModel form = new FormViewModel();
            form.AddField(new TestFormField("Name", "Name:", "Enter a name."));
            form.AddField(new TestFormField("Whut", "Whut?:", "Enter schtuff."));

            form.DeserializeObjectToForm(dummy);

            Assert.AreEqual(dummy.Name, form.Fields[0].Content);
        }
        public void DeserializeObjectToForm_PartialObject_PartiallyPopulatedForm()
        {
            frindle dummy = new frindle();
            dummy.Name = "Waldo";

            FormViewModel form = new FormViewModel();
            form.AddField(new TestFormField("Name", "Name:", "Enter a name."));
            form.AddField(new TestFormField("Whut", "Whut?:", "Enter schtuff."));

            form.DeserializeObjectToForm(dummy);

            Assert.AreEqual(dummy.Name, (string)form.Fields[0].Content);
        }
        public void DeserializeObjectToForm_FullObject_CompletedForm()
        {
            frindle dummy = new frindle();
            dummy.Name = "Waldo";
            dummy.Whut = "Navy SEAL";

            FormViewModel form = new FormViewModel();
            form.AddField(new TestFormField("Name", "Name:", "Enter a name."));
            form.AddField(new TestFormField("Whut", "Whut?:", "Enter schtuff."));

            form.DeserializeObjectToForm(dummy);

            Assert.IsTrue((dummy.Name == (string)form.Fields[0].Content) && (dummy.Whut == (string)form.Fields[1].Content));
        }