コード例 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Priority != null)
         {
             hashCode = hashCode * 59 + Priority.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Address != null)
         {
             hashCode = hashCode * 59 + Address.GetHashCode();
         }
         if (Duration != null)
         {
             hashCode = hashCode * 59 + Duration.GetHashCode();
         }
         if (PreparationTime != null)
         {
             hashCode = hashCode * 59 + PreparationTime.GetHashCode();
         }
         if (TimeWindows != null)
         {
             hashCode = hashCode * 59 + TimeWindows.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (RequiredSkills != null)
         {
             hashCode = hashCode * 59 + RequiredSkills.GetHashCode();
         }
         if (AllowedVehicles != null)
         {
             hashCode = hashCode * 59 + AllowedVehicles.GetHashCode();
         }
         if (DisallowedVehicles != null)
         {
             hashCode = hashCode * 59 + DisallowedVehicles.GetHashCode();
         }
         if (MaxTimeInVehicle != null)
         {
             hashCode = hashCode * 59 + MaxTimeInVehicle.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if Shipment instances are equal
        /// </summary>
        /// <param name="input">Instance of Shipment to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Shipment input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Id == input.Id ||
                     (Id != null &&
                      Id.Equals(input.Id))
                     ) &&
                 (
                     Name == input.Name ||
                     (Name != null &&
                      Name.Equals(input.Name))
                 ) &&
                 (
                     Priority == input.Priority ||
                     (Priority != null &&
                      Priority.Equals(input.Priority))
                 ) &&
                 (
                     Pickup == input.Pickup ||
                     (Pickup != null &&
                      Pickup.Equals(input.Pickup))
                 ) &&
                 (
                     Delivery == input.Delivery ||
                     (Delivery != null &&
                      Delivery.Equals(input.Delivery))
                 ) &&
                 (
                     Size == input.Size ||
                     Size != null &&
                     Size.SequenceEqual(input.Size)
                 ) &&
                 (
                     RequiredSkills == input.RequiredSkills ||
                     RequiredSkills != null &&
                     RequiredSkills.SequenceEqual(input.RequiredSkills)
                 ) &&
                 (
                     AllowedVehicles == input.AllowedVehicles ||
                     AllowedVehicles != null &&
                     AllowedVehicles.SequenceEqual(input.AllowedVehicles)
                 ) &&
                 (
                     DisallowedVehicles == input.DisallowedVehicles ||
                     DisallowedVehicles != null &&
                     DisallowedVehicles.SequenceEqual(input.DisallowedVehicles)
                 ) &&
                 (
                     MaxTimeInVehicle == input.MaxTimeInVehicle ||
                     (MaxTimeInVehicle != null &&
                      MaxTimeInVehicle.Equals(input.MaxTimeInVehicle))
                 ));
        }
コード例 #3
0
 public void CreateReqSkill(RequiredSkills requiredSkills)
 {
     if (requiredSkills == null)
     {
         return;
     }
     Context.RequiredSkills.Add(requiredSkills);
     SaveChanges();
 }
コード例 #4
0
 public ActionInfoAttribute(Type[] argAcceptedSubjects, Type[] argAcceptedObjects, params object[] argSkills)
     : this()
 {
     AcceptedSubjects = argAcceptedSubjects;
     AcceptedObjects  = argAcceptedObjects;
     foreach (object ob in argSkills)
     {
         if (ob is string)
         {
             RequiredSkills.Add(Skills.GetSkillByName(ob as string));
         }
     }
 }
コード例 #5
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Priority != null)
         {
             hashCode = hashCode * 59 + Priority.GetHashCode();
         }
         if (Pickup != null)
         {
             hashCode = hashCode * 59 + Pickup.GetHashCode();
         }
         if (Delivery != null)
         {
             hashCode = hashCode * 59 + Delivery.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (RequiredSkills != null)
         {
             hashCode = hashCode * 59 + RequiredSkills.GetHashCode();
         }
         if (AllowedVehicles != null)
         {
             hashCode = hashCode * 59 + AllowedVehicles.GetHashCode();
         }
         if (DisallowedVehicles != null)
         {
             hashCode = hashCode * 59 + DisallowedVehicles.GetHashCode();
         }
         if (MaxTimeInVehicle != null)
         {
             hashCode = hashCode * 59 + MaxTimeInVehicle.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #6
0
        /// <summary>
        /// Parse the result from the answer of question answer activity.
        /// </summary>
        /// <returns></returns>
        public void ParseResult_Execute(object sender, EventArgs e)
        {
            AgentSkill agentSkill = null;

            if (!_currentSkill.IsValidValue(this.Result))
            {
                int index = int.Parse(Result) - 1;
                //the recognition match must be an index rather than the value itself.
                agentSkill = new AgentSkill(_currentSkill, _currentSkill.Values[index]);
                RequiredSkills.Add(agentSkill);
            }
            else if (this._currentSkill.IsValidValue(this.Result))
            {
                //the value itself was recognized.
                agentSkill = new AgentSkill(_currentSkill, this.Result);
                RequiredSkills.Add(agentSkill);
            }
        }
コード例 #7
0
        public void UpdateReqSkill(RequiredSkills requiredSkills)
        {
            if (requiredSkills == null)
            {
                return;
            }
            var entry = GetRequiredSkill(requiredSkills.Id);

            if (entry == null)
            {
                return;
            }
            entry.Name                 = requiredSkills.Name;
            entry.Description          = requiredSkills.Description;
            entry.MinReqYears          = requiredSkills.MinReqYears;
            entry.MaxReqYears          = requiredSkills.MaxReqYears;
            entry.PositionId           = requiredSkills.PositionId;
            Context.Entry(entry).State = EntityState.Modified;
            SaveChanges();
        }
コード例 #8
0
        public void AddNewShareSkill()
        {
            #region Navigate to Share Skills Page

            // Click on Share Skills Page
            ShareSkills.Click();
            Thread.Sleep(1000);

            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkill");

            // Enter Title
            Title.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Title"));
            Base.test.Log(LogStatus.Info, "Title has been successfully entered");

            //Enter description
            Description.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Description"));
            Base.test.Log(LogStatus.Info, "Description has been successfully entered");

            //click on category dropdown menu
            Thread.Sleep(500);
            Category.Click();
            Thread.Sleep(1000);


            //Select the category
            ProgrammingandTech.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Category"));
            Thread.Sleep(1000);


            //Click on subcatogory drop down option
            Thread.Sleep(1000);
            SubCategory.Click();

            //Select the Sub-Category option
            SubCategory.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Subcategory"));
            SubCategory.SendKeys(Keys.Enter);
            Base.test.Log(LogStatus.Info, "SubCategory has been successfully entered");
            QA.Click();


            //Enter Tags
            Tags.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Tags"));
            Tags.SendKeys(Keys.Enter);
            Base.test.Log(LogStatus.Info, "TagName has been successfully entered");

            //Select service type
            //ServiceTypeHourly.Click();

            if (GlobalDefinitions.ExcelLib.ReadData(2, "Service Type") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "Service Type") == "One-off service")
            {
                ServiceTypeOneOff.Click();
            }

            //Select Location Type
            //LocationTypeOnline.Click();
            if (GlobalDefinitions.ExcelLib.ReadData(2, "Location Type") == "Online")
            {
                LocationTypeOnline.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "Location Type") == "On-site")
            {
                LocationTypeOnsite.Click();
            }



            //Click the start date
            StartDate.Click();
            Thread.Sleep(500);

            //Select the date
            Thread.Sleep(500);
            StartDate.SendKeys(Keys.Backspace);
            StartDate.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Start Date"));

            //Select the end Date
            Thread.Sleep(1000);
            EndDate.SendKeys(Keys.Backspace);
            EndDate.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "End Date"));

            //Select the Days available
            selectDays.Click();
            Thread.Sleep(500);

            //Select starttime
            Thread.Sleep(1000);
            StartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Start Time"));

            //Select EndTime
            Thread.Sleep(1000);
            EndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "End Time"));

            //Select Skill Trade
            Credit.Click();
            Thread.Sleep(500);
            if (GlobalDefinitions.ExcelLib.ReadData(2, "Skill Trade") == "Skill-exchange")
            {
                RequiredSkills.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill Trade"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "Skill Trade") == "Credit")
            {
                CreditAmount.Click();
                CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Credit Amount"));
                CreditAmount.SendKeys(Keys.Enter);

                //Enter credit amount
                // CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Credit Amount"));

                //Select the stats
                // StatusActive.Click();
                //Thread.Sleep(500);
                if (GlobalDefinitions.ExcelLib.ReadData(2, "Status") == "Active")
                {
                    StatusActive.Click();
                }
                else if (GlobalDefinitions.ExcelLib.ReadData(2, "Status") == "Hidden")
                {
                    StatusHidden.Click();
                }

                //Save the Share Skill
                Thread.Sleep(500);
                SaveShareSkills.Click();
                Thread.Sleep(500);


                //Verify if newShared skill is saved
                Thread.Sleep(3000);
                string ShareSkillSucess = Global.GlobalDefinitions.driver.FindElement(By.CssSelector("#listing-management-section > div:nth-child(3) > div:nth-child(2) > table > thead > tr > th:nth-child(1)")).Text;

                if (ShareSkillSucess == "Image")
                {
                    Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Saved Skill Successful");
                }
                else
                {
                    Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Saving Skill Unsuccessful");
                }
            }
        }
コード例 #9
0
        /// <summary>
        /// Returns true if Service instances are equal
        /// </summary>
        /// <param name="input">Instance of Service to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Service input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Id == input.Id ||
                     (Id != null &&
                      Id.Equals(input.Id))
                     ) &&
                 (
                     Type == input.Type ||
                     (Type != null &&
                      Type.Equals(input.Type))
                 ) &&
                 (
                     Priority == input.Priority ||
                     (Priority != null &&
                      Priority.Equals(input.Priority))
                 ) &&
                 (
                     Name == input.Name ||
                     (Name != null &&
                      Name.Equals(input.Name))
                 ) &&
                 (
                     Address == input.Address ||
                     (Address != null &&
                      Address.Equals(input.Address))
                 ) &&
                 (
                     Duration == input.Duration ||
                     (Duration != null &&
                      Duration.Equals(input.Duration))
                 ) &&
                 (
                     PreparationTime == input.PreparationTime ||
                     (PreparationTime != null &&
                      PreparationTime.Equals(input.PreparationTime))
                 ) &&
                 (
                     TimeWindows == input.TimeWindows ||
                     TimeWindows != null &&
                     TimeWindows.SequenceEqual(input.TimeWindows)
                 ) &&
                 (
                     Size == input.Size ||
                     Size != null &&
                     Size.SequenceEqual(input.Size)
                 ) &&
                 (
                     RequiredSkills == input.RequiredSkills ||
                     RequiredSkills != null &&
                     RequiredSkills.SequenceEqual(input.RequiredSkills)
                 ) &&
                 (
                     AllowedVehicles == input.AllowedVehicles ||
                     AllowedVehicles != null &&
                     AllowedVehicles.SequenceEqual(input.AllowedVehicles)
                 ) &&
                 (
                     DisallowedVehicles == input.DisallowedVehicles ||
                     DisallowedVehicles != null &&
                     DisallowedVehicles.SequenceEqual(input.DisallowedVehicles)
                 ) &&
                 (
                     MaxTimeInVehicle == input.MaxTimeInVehicle ||
                     (MaxTimeInVehicle != null &&
                      MaxTimeInVehicle.Equals(input.MaxTimeInVehicle))
                 ));
        }
コード例 #10
0
        public void AddNewSkill()
        {
            #region Navigate to Share Skills Page
            // Click on Share Skills Page
            ShareSkill.WaitForElementClickable(_driver, 60);
            ShareSkill.Click();
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ShareSkills");

            #endregion


            #region Enter Title
            Title.WaitForElementClickable(_driver, 60);
            //Enter the data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title"));

            #endregion

            #region Enter Description

            //Enter the data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription"));


            #endregion

            #region Category Drop Down

            // Click on Category Dropdown
            Category.Click();


            // Select Category from Category Drop Down
            var SelectElement = new SelectElement(Category);
            SelectElement.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "category")));

            // Click on Sub-Category Dropdown
            SubCategory.Click();

            //Select Sub-Category from the Drop Down
            var SelectElement1 = new SelectElement(SubCategory);
            SelectElement1.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "subcategory")));
            #endregion

            #region Tags
            // Eneter Tag
            Tag.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName"));
            Tag.SendKeys(Keys.Enter);

            #endregion

            #region Service Type Selection

            // Service Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
            {
                ServiceTypeOnOff.Click();
            }
            #endregion

            #region Select Location Type
            // Location Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site")
            {
                LocationTypeOnsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online")
            {
                LocationTypeOnline.Click();
            }
            #endregion

            #region Select Available Dates from Calendar
            // Select Start Date
            StartDate.Click();
            // Select End Date
            EndDate.Click();
            #endregion


            #region Select Skill Trade
            // Select Skill Trade

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange")
            {
                RequiredSkills.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit")
            {
                CreditAmount.Click();
                CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                CreditAmount.SendKeys(Keys.Enter);
            }
            #endregion

            #region Select User Status
            // Select User Status

            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }
            #endregion


            #region Add Work Sample

            //Work Sample upload button path
            IWebElement upload = _driver.FindElement(By.XPath("//*[@id='selectFile']"));

            // Uploading File path
            var    GetCurrentDirectory = Directory.GetCurrentDirectory();
            String path = GetCurrentDirectory + @"\MarsFramework\Upload Files\Samplework.txt";
            upload.SendKeys(path);



            #endregion

            #region Save / Cancel Skill
            // Save or Cancel New Skill

            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                SaveShareSkills.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                CancelShareSkills.Click();
            }
            #endregion


            #region Check whether New  skill created sucessfully

            string ShareSkillSucess = _driver.FindElement(By.LinkText("Manage Listings")).Text;

            if (ShareSkillSucess == "Manage Listings")
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Shared Skill Successful");
            }
            else
            {
                Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Share Skill Unsuccessful");
            }
            #endregion
        }
コード例 #11
0
        public void EditSkill()
        {
            #region populate excel

            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(MarsResources.ExcelPath, "Managelisting");
            #endregion

            #region Enter Title
            Title.WaitForElementClickable(Global.Base.driver, 60);
            //Enter the data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title"));
            #endregion

            #region Enter Description
            //Enter the data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription"));
            #endregion

            #region Category Drop Down

            // Click on Category Dropdown
            Category.Click();
            Thread.Sleep(1000);
            // Select Category from Category Drop Down
            var selectElement = new SelectElement(Category);
            selectElement.SelectByIndex(3);
            // Click on Sub-Category Dropdown
            SubCategory.Click();
            Thread.Sleep(1000);
            //Select Sub-Category from the Drop Down
            var SelectElement1 = new SelectElement(SubCategory);
            SelectElement1.SelectByIndex(4);
            #endregion

            #region Tags
            // Eneter Tag
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName"));
            Tags.SendKeys(Keys.Enter);
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "TagName"));
            Tags.SendKeys(Keys.Enter);
            #endregion

            #region Service Type Selection
            // Service Type Selection
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
            {
                ServiceTypeOnOff.Click();
            }
            #endregion

            #region Select Location Type
            // Location Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site")
            {
                LocationTypeOnsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online")
            {
                LocationTypeOnline.Click();
            }
            #endregion

            #region Select Available Dates from Calendar
            // Select Start Date
            //StartDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartDate"));
            // Select End Date
            EndDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndDate"));
            // select available days and start time and End time
            for (int i = 2; i < 9; i++)
            {
                for (int j = 2; j < 9; j++)
                {
                    for (int k = 2; k < 9; k++)
                    {
                        IWebElement SatrtTime     = driver.FindElement(By.XPath("//div[" + i + "]/div[2]/input"));
                        IWebElement EndTime       = driver.FindElement(By.XPath("//div[" + j + "]/div[3]/input"));
                        IWebElement AvailableDays = driver.FindElement(By.XPath("//div[7]/div[2]/div/div[" + k + "]/div[1]/div/input"));
                        if (i == 2 && j == 2 && k == 2)
                        {
                            AvailableDays.Click();
                            SatrtTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartTime"));
                            EndTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndTime"));
                        }
                        if (i == 3 && j == 3 && k == 3)
                        {
                            AvailableDays.Click();
                            SatrtTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "StartTime"));
                            EndTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "EndTime"));
                        }
                        if (i == 4 && j == 4 && k == 4)
                        {
                            AvailableDays.Click();
                            SatrtTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(4, "StartTime"));
                            EndTime.SendKeys(GlobalDefinitions.ExcelLib.ReadData(4, "EndTime"));
                        }
                    }
                }
            }
            #endregion
            #region Select Skill Trade
            // Select Skill Trade
            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange")
            {
                SkillExchange.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit")
            {
                CreditAmount.Click();
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                CreditAmount.SendKeys(Keys.Enter);
            }
            #endregion

            #region Select User Status
            // Select User Status

            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }
            #endregion

            #region Add Work Sample
            //Click on Work sample
            WorkSample.Click();
            //AutoIT
            AutoItX3 AutoIt = new AutoItX3();
            AutoIt.WinActivate("Open");
            Thread.Sleep(3000);
            AutoIt.Send(@"A:\AdvanceTask\StandardTask\TW.docx");
            Thread.Sleep(2000);
            AutoIt.Send("{ENTER}");
            #endregion

            #region Save / Cancel Skill
            // Save or Cancel New Skill
            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                Save.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                Cancel.Click();
            }
            #endregion

            Thread.Sleep(3000);
            #region Check whether New  skill updated sucessfully

            //String expectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "title");
            // Validate view listing through Page title
            String actualTitle = driver.Title;

            // Assert.AreEqual(actualTitle, "ListingManagement");

            if (actualTitle == "ListingManagement")
            {
                Assert.IsTrue(true);
                Global.Base.test.Log(Status.Pass, "Shared Skill Successful");
                SaveScreenShotClass.SaveScreenshot(driver, "AddShareSkill");
            }
            else
            {
                Console.WriteLine("Test failed");
                SaveScreenShotClass.SaveScreenshot(driver, "FailedAddShareSkill");
                Global.Base.test.Log(Status.Fail, "Share Skill Unsuccessful");
            }
            #endregion
        }
コード例 #12
0
        public void EditSkill()
        {
            #region populate excel

            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(MarsResources.ExcelPath, "Managelisting");
            #endregion

            #region Enter Title
            Title.WaitForElementClickable(Global.Base.driver, 60);
            //Enter the data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title"));
            #endregion

            #region Enter Description
            //Enter the data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription"));
            #endregion

            #region Category Drop Down

            // Click on Category Dropdown
            Category.Click();
            Thread.Sleep(1000);
            // Select Category from Category Drop Down
            var selectElement = new SelectElement(Category);
            selectElement.SelectByIndex(3);
            // Click on Sub-Category Dropdown
            SubCategory.Click();
            Thread.Sleep(1000);
            //Select Sub-Category from the Drop Down
            var SelectElement1 = new SelectElement(SubCategory);
            SelectElement1.SelectByIndex(4);
            #endregion

            #region Tags
            // Eneter Tag
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName"));
            Tags.SendKeys(Keys.Enter);
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "TagName"));
            Tags.SendKeys(Keys.Enter);
            #endregion

            #region Service Type Selection
            // Service Type Selection
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
            {
                ServiceTypeOnOff.Click();
            }
            #endregion

            #region Select Location Type
            // Location Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site")
            {
                LocationTypeOnsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online")
            {
                LocationTypeOnline.Click();
            }
            #endregion

            #region Select Available Dates from Calendar
            // Select Start Date
            //StartDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartDate"));
            // Select End Date
            EndDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndDate"));

            // select available days and start time and End time


            IList <IWebElement> Sttim = driver.FindElements(By.Name("StartTime"));
            IList <IWebElement> Edtim = driver.FindElements(By.Name("EndTime"));
            IList <IWebElement> Ckbx  = driver.FindElements(By.XPath("(//input[@name='Available'])"));

            if (Ckbx.Count != 0)
            {
                //Selecting checkboxes for days from Monday to Friday
                for (int i = 1; i <= Ckbx.Count - 2; i++)
                {
                    //Verify whether checkbox is not selected
                    if (!Ckbx.ElementAt(i).Selected)
                    {
                        Ckbx.ElementAt(i).Click();
                    }
                    //Validating the Count

                    Sttim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "StartTime"));
                    Thread.Sleep(2000);
                    Edtim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "EndTime"));
                    Thread.Sleep(2000);
                }
            }

            #endregion
            #region Select Skill Trade
            // Select Skill Trade
            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange")
            {
                SkillExchange.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit")

            {
                Credit.Click();
                CreditAmount.Click();
                string input = GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange");

                int result = Int32.Parse(input);

                if (result >= 10)
                {
                    SaveScreenShotClass.SaveScreenshot(driver, "More than One digit not Possible");
                    Global.Base.test.Log(Status.Fail, "Two Digit not Added ");
                    Assert.Fail("Entering more than One digit not Possible");
                }
                else
                {
                    CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                    CreditAmount.SendKeys(Keys.Enter);
                }
            }
            #endregion

            #region Select User Status
            // Select User Status

            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }
            #endregion



            #region Save / Cancel Skill
            // Save or Cancel New Skill
            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                Save.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                Cancel.Click();
            }
            #endregion

            Thread.Sleep(3000);
            #region Check whether New  skill updated sucessfully

            //String expectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "title");
            // Validate view listing through Page title
            String actualTitle = driver.Title;

            // Assert.AreEqual(actualTitle, "ListingManagement");

            if (actualTitle == "ListingManagement")
            {
                Assert.IsTrue(true);
                Global.Base.test.Log(Status.Pass, "Shared Skill Successful");
                SaveScreenShotClass.SaveScreenshot(driver, "AddShareSkill");
            }
            else
            {
                Console.WriteLine("Test failed");
                SaveScreenShotClass.SaveScreenshot(driver, "FailedAddShareSkill");
                Global.Base.test.Log(Status.Fail, "Share Skill Unsuccessful");
            }
            #endregion
        }
コード例 #13
0
        public void AddNewSkill()
        {
            #region Navigate to Share Skills Page
            // Click on Share Skills Page
            ShareSkill.WaitForElementClickable(Global.Base.driver, 60);
            ShareSkill.Click();
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(MarsResources.ExcelPath, "ShareSkills");
            #endregion

            #region Enter Title
            Title.WaitForElementClickable(Global.Base.driver, 60);
            //Enter the data in Title textbox
            Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "title"));
            #endregion

            #region Enter Description
            //Enter the data in Description textbox
            Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EnterDescription"));
            #endregion

            #region Category Drop Down

            // Click on Category Dropdown
            Category.Click();
            // Select Category from Category Drop Down
            var SelectElement = new SelectElement(Category);
            SelectElement.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "category")));
            // Click on Sub-Category Dropdown
            SubCategory.Click();
            //Select Sub-Category from the Drop Down
            var SelectElement1 = new SelectElement(SubCategory);
            SelectElement1.SelectByText((GlobalDefinitions.ExcelLib.ReadData(2, "subcategory")));
            #endregion

            #region Tags
            // Eneter Tag
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "TagName"));
            Tags.SendKeys(Keys.Enter);
            Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "TagName"));
            Tags.SendKeys(Keys.Enter);
            #endregion

            #region Service Type Selection
            // Service Type Selection
            if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "Hourly basis service")
            {
                ServiceTypeHourly.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "ServiceType") == "One-off service")
            {
                ServiceTypeOnOff.Click();
            }
            #endregion

            #region Select Location Type
            // Location Type Selection

            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "On-site")
            {
                LocationTypeOnsite.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectLocationType") == "Online")
            {
                LocationTypeOnline.Click();
            }
            #endregion

            #region Select Available Dates from Calendar
            // Select Start Date
            //StartDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "StartDate"));
            // Select End Date

            EndDate.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "EndDate"));

            // select available days and start time and End time

            // select available days and start time and End time
            Thread.Sleep(3000);
            IList <IWebElement> Sttim = driver.FindElements(By.Name("StartTime"));

            IList <IWebElement> Edtim = driver.FindElements(By.Name("EndTime"));
            //Driver.FindElements(By.Name("EndTime"));
            IList <IWebElement> Ckbx = driver.FindElements(By.XPath("(//input[@name='Available'])"));

            if (Ckbx.Count != 0)
            {
                //Selecting checkboxes for days from Monday to Friday
                for (int i = 1; i <= Ckbx.Count - 2; i++)
                {
                    //Verify whether checkbox is not selected
                    if (!Ckbx.ElementAt(i).Selected)
                    {
                        Ckbx.ElementAt(i).Click();
                    }
                    Console.WriteLine(driver);
                    //Validating the Count


                    Sttim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "StartTime"));
                    // Sttim.ElementAt(i).SendKeys("10:00");


                    /*  var Svalue = Sttim.ElementAt(i).GetAttribute("value");
                     * Console.WriteLine(Svalue);
                     * Sttim.ElementAt(i).SendKeys(Svalue);*/

                    Thread.Sleep(2000);
                    // Sttim.ElementAt(i).Clear();
                    Edtim.ElementAt(i).SendKeys(GlobalDefinitions.ExcelLib.ReadData(i + 1, "EndTime"));
                    // Edtim.ElementAt(i).SendKeys("18:00");
                    Thread.Sleep(2000);
                }
            }



            #endregion
            #region Select Skill Trade
            // Select Skill Trade
            if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Skill-exchange")
            {
                SkillExchange.Click();
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
                RequiredSkills.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "ExchangeSkill"));
                RequiredSkills.SendKeys(Keys.Enter);
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "SelectSkillTrade") == "Credit")
            {
                CreditAmount.Click();
                CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "AmountInExchange"));
                CreditAmount.SendKeys(Keys.Enter);
            }
            #endregion

            #region Select User Status
            // Select User Status

            if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Active")
            {
                StatusActive.Click();
            }
            else if (GlobalDefinitions.ExcelLib.ReadData(2, "UserStatus") == "Hidden")
            {
                StatusHidden.Click();
            }
            #endregion



            #region Save / Cancel Skill
            // Save or Cancel New Skill
            if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Save")
            {
                Save.Click();
            }
            else if (Global.GlobalDefinitions.ExcelLib.ReadData(2, "SaveOrCancel") == "Cancel")
            {
                Cancel.Click();
            }
            #endregion
            Thread.Sleep(3000);
            #region Check whether New  skill created sucessfully

            //String expectedValue = GlobalDefinitions.ExcelLib.ReadData(2, "title");
            String actualTitle = driver.Title;
            //string ShareSkillSucess = Driver.FindElement(By.TagName("h2")).Text;
            if (actualTitle == "ListingManagement")
            {
                Assert.IsTrue(true);
                Global.Base.test.Log(Status.Pass, "Shared Skill Successful");
                SaveScreenShotClass.SaveScreenshot(driver, "AddShareSkill");
            }
            else
            {
                Console.WriteLine("Test failed");
                SaveScreenShotClass.SaveScreenshot(driver, "FailedAddShareSkill");
                Global.Base.test.Log(Status.Fail, "Share Skill Unsuccessful");
            }
            #endregion
        }
コード例 #14
0
ファイル: FeatSelection.cs プロジェクト: DnDGen/CreatureGen
        public bool ImmutableRequirementsMet(
            int baseAttackBonus,
            Dictionary <string, Ability> abilities,
            IEnumerable <Skill> skills,
            IEnumerable <Attack> attacks,
            int casterLevel,
            Dictionary <string, Measurement> speeds,
            int naturalArmor,
            int hands,
            string size,
            bool canUseEquipment)
        {
            if (baseAttackBonus < RequiredBaseAttack)
            {
                return(false);
            }

            if (casterLevel < MinimumCasterLevel)
            {
                return(false);
            }

            if (hands < RequiredHands)
            {
                return(false);
            }

            if (RequiresNaturalArmor && naturalArmor <= 0)
            {
                return(false);
            }

            if (RequiresEquipment && !canUseEquipment)
            {
                return(false);
            }

            if (RequiresSpecialAttack && !attacks.Any(a => a.IsSpecial))
            {
                return(false);
            }

            if (attacks.Count(a => a.IsNatural) < RequiredNaturalWeapons)
            {
                return(false);
            }

            if (RequiredSkills.Any() && !RequiredSkills.All(s => s.RequirementMet(skills)))
            {
                return(false);
            }

            if (RequiredSizes.Any() && !RequiredSizes.Contains(size))
            {
                return(false);
            }

            foreach (var requiredAbility in RequiredAbilities)
            {
                if (abilities[requiredAbility.Key].FullScore < requiredAbility.Value)
                {
                    return(false);
                }
            }

            foreach (var requiredSpeed in RequiredSpeeds)
            {
                if (!speeds.ContainsKey(requiredSpeed.Key) || speeds[requiredSpeed.Key].Value < requiredSpeed.Value)
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #15
0
 public void UpdateReqSkill(RequiredSkills requiredSkills)
 {
     _skillsRepository.UpdateReqSkill(requiredSkills);
 }
コード例 #16
0
 public void CreateReqSkill(RequiredSkills requiredSkills)
 {
     _skillsRepository.CreateReqSkill(requiredSkills);
 }