Пример #1
0
 public void WhenISearchAPropertyAndTryToEdit()
 {
     MyProperties.EditProperty();
     //Console.WriteLine(Global.GlobalDriver.driver.Title);
     Assert.AreEqual("Properties | Property Community", Global.GlobalDriver.driver.Title);
     CommonFeatures.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Property Edited Successfully");
 }
        void IPersistable.LoadFrom(IPersistency persistency)
        {
            string instance = DockItem.Id.ToString();

            m_Properties = new MyProperties();
            m_Properties.ColorStraight           = persistency.LoadSetting(instance, "ColorStraight", Color.Brown);
            m_Properties.ColorLine               = persistency.LoadSetting(instance, "ColorLine", Color.Beige);
            m_Properties.ColorCircle             = persistency.LoadSetting(instance, "ColorCircle", Color.Red);
            m_Properties.ColorClothoide          = persistency.LoadSetting(instance, "ColorClothoide", Color.Green);
            m_Properties.ColorOther              = persistency.LoadSetting(instance, "ColorOther", Color.Brown);
            m_Properties.ColorNodes              = persistency.LoadSetting(instance, "ColorNodes", Color.Blue);
            m_Properties.ColorNodeSelected       = persistency.LoadSetting(instance, "ColorNodeSelected", Color.YellowGreen);
            m_Properties.DrawConnections         = persistency.LoadSetting(instance, "DrawConnections", m_Properties.DrawConnections);
            m_Properties.DrawInformation         = persistency.LoadSetting(instance, "DrawInformation", m_Properties.DrawInformation);
            m_Properties.DrawWholeInnerCircle    = persistency.LoadSetting(instance, "DrawWholeInnerCircle", m_Properties.DrawWholeInnerCircle);
            m_Properties.DrawConstructionsPoints = persistency.LoadSetting(instance, "DrawConstructionsPoints", m_Properties.DrawConstructionsPoints);
            m_Properties.LineWidth               = persistency.LoadSetting(instance, "LineWidth", 3);

            int count = persistency.LoadSetting(instance, "NodeCount", 0);

            for (int i = 0; i < count; i++)
            {
                var X = persistency.LoadSetting(instance, "NodeX" + i.ToString(), 0.0);
                var Y = persistency.LoadSetting(instance, "NodeY" + i.ToString(), 0.0);
                m_Nodes.Add(new PointF((float)X, (float)Y));
            }
        }
        void IPersistable.LoadFrom(IPersistency persistency)
        {
            // string instance = DockItem.Id.ToString();

            m_Properties      = new MyProperties();
            m_HeadingSmoother = new HeadingSmoother();
            Update();
        }
Пример #4
0
    static Object getProperty(MyProperties prop)
    {
        if (!cache.ContainsKey(prop))
        {
            cache.add(prop, "SOMETHING");
        }

        return(cache[prop]);
    }
Пример #5
0
        public void Properties_derived_classes_should_expose_reflected_properties()
        {
            var pp = new MyProperties()
            {
                A = "a"
            };

            Assert.True(pp.HasProperty("A"));
            Assert.Equal("a", pp.GetProperty("A"));
        }
Пример #6
0
        public void PropertyHelperWorksForStruct()
        {
            // Arrange
            var anonymous = new MyProperties();

            anonymous.IntProp    = 3;
            anonymous.StringProp = "Five";

            // Act + Assert
            PropertyHelper helper1 = Assert.Single(PropertyHelper.GetProperties(anonymous), prop => prop.Name == "IntProp");
            PropertyHelper helper2 = Assert.Single(PropertyHelper.GetProperties(anonymous), prop => prop.Name == "StringProp");

            Assert.Equal(3, helper1.GetValue(anonymous));
            Assert.Equal("Five", helper2.GetValue(anonymous));
        }
Пример #7
0
        public void PropertyHelper_WorksForStruct()
        {
            // Arrange
            var anonymous = new MyProperties();

            anonymous.IntProp    = 3;
            anonymous.StringProp = "Five";

            // Act + Assert
            var helper1 = Assert2.Single(PropertyHelper.GetPropertyAccessors(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "IntProp"));
            var helper2 = Assert2.Single(PropertyHelper.GetPropertyAccessors(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "StringProp"));

            Assert2.Equal(3, helper1.GetValue(anonymous));
            Assert2.Equal("Five", helper2.GetValue(anonymous));
        }
Пример #8
0
        public void PropertyHelper_WorksForStruct()
        {
            if (TestPlatformHelper.IsMono)
            {
                // PropertyHelper seems to be broken for value types on Mono.
                return;
            }

            // Arrange
            var anonymous = new MyProperties();

            anonymous.IntProp    = 3;
            anonymous.StringProp = "Five";

            // Act + Assert
            var helper1 = Assert.Single(PropertyHelper.GetProperties(anonymous).Where(prop => prop.Name == "IntProp"));
            var helper2 = Assert.Single(PropertyHelper.GetProperties(anonymous).Where(prop => prop.Name == "StringProp"));

            Assert.Equal(3, helper1.GetValue(anonymous));
            Assert.Equal("Five", helper2.GetValue(anonymous));
        }
Пример #9
0
        void AddClass(string name, ManagementClass c)
        {
            TreeNode node = treeClasses.Nodes[0];

            if (c.Derivation.Contains("__Event"))
            {
                Globals.FindOrAddNode("Event-Generating", ref node);
                MyEvents.Classify(name, ref node);
            }
            else
            {
                if (TestForProperties(c, ref node))
                {
                    MyProperties.Classify(name, ref node);
                }
                else
                {
                    Globals.FindOrAddNode("Other", ref node);
                    MyOther.Classify(name, ref node);
                }
            }
            node.Nodes.Add(name, name, 3, 2);
        }
Пример #10
0
    public static void Main()
    {
        MyProperties props  = MyProperties.GetInstance();
        MyProperties props2 = MyProperties.GetInstance();

        Console.WriteLine("Should be true : " + (props == props2));
        //Add some keys and values
        props.SetProperty("Rick", "Pine Forest Senior High");
        props.SetProperty("Steve", "Seventy-First High School");
        props.SetProperty("Jake", "Terry Sanford High School");
        props.SetProperty("Laura", "Westover High School");
        props.SetProperty("Bob", "Reid Ross High School");
        //Save to XML file
        props.Store();
        //Read XML file
        props.Read();
        //Write values to console
        Console.WriteLine("----------------------------------");
        Console.WriteLine("Rick attended " + props.GetProperty("Rick"));
        Console.WriteLine("Steve attended " + props.GetProperty("Steve"));
        Console.WriteLine("Jake attended " + props.GetProperty("Jake"));
        Console.WriteLine("Laura attended " + props.GetProperty("Laura"));
        Console.WriteLine("Bob attended " + props.GetProperty("Bob"));
    }
 public ProcessedUser(TeamsParticipant userId, MyProperties props)
 {
     Properties = props;
     UserId     = userId;
 }
Пример #12
0
 public A()
 {
     Property = new MyProperties();
 }
Пример #13
0
        public void PropertyHelper_WorksForStruct()
        {
            // Arrange
            var anonymous = new MyProperties();

            anonymous.IntProp = 3;
            anonymous.StringProp = "Five";

            // Act + Assert
            var helper1 = Assert.Single(PropertyHelper.GetProperties(anonymous).Where(prop => prop.Name == "IntProp"));
            var helper2 = Assert.Single(PropertyHelper.GetProperties(anonymous).Where(prop => prop.Name == "StringProp"));
            Assert.Equal(3, helper1.GetValue(anonymous));
            Assert.Equal("Five", helper2.GetValue(anonymous));
        }
Пример #14
0
 public UserControl1()
 {
     InitializeComponent();
     MyProperties = new MyProperties();
 }
	// Overloaded GetInstance() method
	public static MyProperties GetInstance(string filename){
		if(_props == null){
			_props = new MyProperties(filename);
		}
		return _props;
	}
Пример #16
0
        private async void ListItemClicked(int position)
        {
            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                int       id   = int.Parse(ap.getAccessKey());
                string    url  = "http://housechecker.co.uk/api/export.php";
                JsonValue json = await FetchUserAsync(url);

                string         jsonString      = json.ToString();
                List <Student> listOfLandlords = JsonConvert.DeserializeObject <List <Student> >(jsonString);
                var            user            = listOfLandlords.Where(a => a.Id == id).FirstOrDefault();

                if (user.Type == "Landlord")
                {
                    IMenuItem item1 = navigationView.Menu.FindItem(Resource.Id.nav_extra1);
                    item1.SetTitle("Add Property");
                    IMenuItem item2 = navigationView.Menu.FindItem(Resource.Id.nav_extra2);
                    item2.SetTitle("My Properties");
                    // If the user type is Landlord, it sets the two extra features to these options
                }
                else
                {
                    IMenuItem item1 = navigationView.Menu.FindItem(Resource.Id.nav_extra1);
                    item1.SetTitle("Favourite Properties");
                    IMenuItem item2 = navigationView.Menu.FindItem(Resource.Id.nav_extra2);
                    item2.SetTitle("My Reviews");
                    // If you're a student the options are different
                }
                // Gets the list of users and finds the one that matches your ID

                usernameDisplay = FindViewById <TextView>(Resource.Id.navBarHeader);
                // Gets the display name for the nav bar


                if (user.Type == "Landlord")
                {
                    fragment             = LandlordDashboard.NewInstance();
                    usernameDisplay.Text = user.CompanyName;
                    // Sets the name to company name if you are a landlord
                }
                else
                {
                    fragment             = StudentDashboard.NewInstance();
                    usernameDisplay.Text = user.Name;
                    // And to username if you are a student
                }
                break;

            case 1:
                fragment = PropertyDetail.NewInstance();
                Bundle idBundle = new Bundle();
                idBundle.PutString("accomID", "77");
                fragment.Arguments = idBundle;
                // This code calls the new fragment and places it on the screen aka loading a new page
                break;

            case 2:
                fragment = SearchPage.NewInstance();
                break;

            case 3:
                fragment = Profile.NewInstance();
                break;

            case 4:
                if (userType == "Landlord")
                {
                    fragment = AddProperty.NewInstance();
                }
                else
                {
                    fragment = DisplayFavourites.NewInstance();
                }
                break;

            case 5:
                if (userType == "Landlord")
                {
                    fragment = MyProperties.NewInstance();
                }
                else
                {
                    fragment = MyReviews.NewInstance();
                }
                break;

            case 6:
                id   = int.Parse(ap.getAccessKey());
                url  = "http://housechecker.co.uk/api/export.php";
                json = await FetchUserAsync(url);

                jsonString      = json.ToString();
                listOfLandlords = JsonConvert.DeserializeObject <List <Student> >(jsonString);
                user            = listOfLandlords.Where(a => a.Id == id).FirstOrDefault();

                if (user.Type == "Landlord")
                {
                    IMenuItem item1 = navigationView.Menu.FindItem(Resource.Id.nav_extra1);
                    item1.SetTitle("Add Property");
                    IMenuItem item2 = navigationView.Menu.FindItem(Resource.Id.nav_extra2);
                    item2.SetTitle("My Properties");
                    // If the user type is Landlord, it sets the two extra features to these options
                }
                else
                {
                    IMenuItem item1 = navigationView.Menu.FindItem(Resource.Id.nav_extra1);
                    item1.SetTitle("Favourite Properties");
                    IMenuItem item2 = navigationView.Menu.FindItem(Resource.Id.nav_extra2);
                    item2.SetTitle("My Reviews");
                    // If you're a student the options are different
                }
                // Gets the list of users and finds the one that matches your ID

                url  = "http://housechecker.co.uk/api/display.php";
                json = await FetchUserAsync(url);

                jsonString = json.ToString();
                var addressList = JsonConvert.DeserializeObject <List <Address> >(jsonString);

                accomID  = addressList.Where(a => a.address1 == markerTitle).FirstOrDefault().id;
                fragment = PropertyDetail.NewInstance();
                Bundle bundle = new Bundle();
                bundle.PutString("accomID", accomID.ToString());
                fragment.Arguments = bundle;
                // Gets the accomodation that has been clicked on from the map page and then loads it
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
            // Commits the transaction
        }
 public void WhenITryToNavigate()
 {
     MyProperties.PageNavigation();
     CommonFeatures.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Navigation Successful");
 }
 public void WhenISearchAPropertyAndTryToDelete()
 {
     MyProperties.DeleteProperty();
     CommonFeatures.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Successful Delete");
 }
Пример #19
0
 public MyClassInFirstNamespace(MyProperties _properties)
 {
 }
Пример #20
0
 static PropertyInfo MyPropertyByName(string name)
 {
     return(MyProperties.SingleOrDefault(p => p.Name.Equals(name, StringComparison.OrdinalIgnoreCase)));
 }