Exemplo n.º 1
0
 public void GivenNameTest()
 {
     NameLabel nameLabel = new NameLabel();
     Assert.AreEqual(nameLabel.GivenName, string.Empty, "Expected GivenName to initially be empty string");
     nameLabel.GivenName = "John";
     Assert.AreEqual(nameLabel.GivenName, "John", "GivenName property not set as expected");
 }
Exemplo n.º 2
0
 public void LastNameTest()
 {
     NameLabel nameLabel = new NameLabel();
     Assert.AreEqual(nameLabel.FamilyName, string.Empty, "Expected family name to initially be empty string");
     nameLabel.FamilyName = "Evans";
     Assert.AreEqual(nameLabel.FamilyName, "Evans", "Family name property not set as expected");
 }
Exemplo n.º 3
0
        public void DisplayValueTest()
        {
            NameLabel nameLabel = new NameLabel();

            Assert.AreEqual(nameLabel.DisplayValue, string.Empty, "Expected display value to initially be empty string");

            nameLabel.FamilyName = "Evans";
            Assert.AreEqual(nameLabel.DisplayValue, "EVANS", "Expected display value to be 'EVANS'");

            nameLabel.GivenName = "John";
            Assert.AreEqual(nameLabel.DisplayValue, "EVANS, John", "Expected display value to be 'EVANS John'");

            nameLabel.Title = "Mr";
            Assert.AreEqual(nameLabel.DisplayValue, "EVANS, John (Mr)", "Expected display value to be 'EVANS John (Mr)'");

            nameLabel.FamilyName = string.Empty;
            Assert.AreEqual(nameLabel.DisplayValue, "John (Mr)", "Expected display value to be 'John (Mr)'");

            nameLabel.GivenName = string.Empty;
            Assert.AreEqual(nameLabel.DisplayValue, string.Empty, "Expected display value to be ''");

            nameLabel.GivenName = "John";
            nameLabel.Title = string.Empty;
            Assert.AreEqual(nameLabel.DisplayValue, "John", "Expected display value to be 'John'");
        }
Exemplo n.º 4
0
 public void TitleTest()
 {
     NameLabel nameLabel = new NameLabel();
     Assert.AreEqual(nameLabel.Title, string.Empty, "Expected Title to initially be empty string");
     nameLabel.Title = "Mr";
     Assert.AreEqual(nameLabel.Title, "Mr", "Title property not set as expected");
 }
Exemplo n.º 5
0
        public void FamilyNameLengthTest()
        {
            string testValueTooLong = "Harcourt-Fotherington-Cholmondley-Chillingsworth-Montgomery";
            string testValueExpected = "HARCOURT-FOTHERINGTON-CHOLMONDLEY-CHI...";

            NameLabel nameLabel = new NameLabel();
            nameLabel.FamilyName = testValueTooLong;
            Assert.AreEqual<string>(testValueExpected, nameLabel.DisplayValue, "FamilyName should have been truncated in DisplayValue");
        }
Exemplo n.º 6
0
        public void FamilyNameTest()
        {
            string testValue = "Evans";

            NameLabel nameLabel = new NameLabel();
            Assert.AreEqual<string>(string.Empty, nameLabel.FamilyName, "Expected FamilyName to initially be string.Empty");

            nameLabel.FamilyName = testValue;
            Assert.AreEqual<string>(testValue, nameLabel.FamilyName, "FamilyName property not set as expected");
        }
Exemplo n.º 7
0
        public void GivenNameTest()
        {
            string testValue = "Jane";

            NameLabel nameLabel = new NameLabel();
            Assert.AreEqual<string>(string.Empty, nameLabel.GivenName, "Expected GivenName to initially be string.Empty");

            nameLabel.GivenName = testValue;
            Assert.AreEqual<string>(testValue, nameLabel.GivenName, "GivenName property not set as expected");
        }
        void ReleaseDesignerOutlets()
        {
            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (StateLabel != null)
            {
                StateLabel.Dispose();
                StateLabel = null;
            }
        }
Exemplo n.º 9
0
        void ReleaseDesignerOutlets()
        {
            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (SelectedImage != null)
            {
                SelectedImage.Dispose();
                SelectedImage = null;
            }
        }
Exemplo n.º 10
0
        void ReleaseDesignerOutlets()
        {
            if (AddToCartButton != null)
            {
                AddToCartButton.Dispose();
                AddToCartButton = null;
            }

            if (AmountText != null)
            {
                AmountText.Dispose();
                AmountText = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (HotDogImageView != null)
            {
                HotDogImageView.Dispose();
                HotDogImageView = null;
            }

            if (LongDescriptionText != null)
            {
                LongDescriptionText.Dispose();
                LongDescriptionText = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (PriceLabel != null)
            {
                PriceLabel.Dispose();
                PriceLabel = null;
            }

            if (ShortDescriptionLabel != null)
            {
                ShortDescriptionLabel.Dispose();
                ShortDescriptionLabel = null;
            }
        }
Exemplo n.º 11
0
        void ReleaseDesignerOutlets()
        {
            if (AccessLabel != null)
            {
                AccessLabel.Dispose();
                AccessLabel = null;
            }

            if (buttonRenew != null)
            {
                buttonRenew.Dispose();
                buttonRenew = null;
            }

            if (imageView != null)
            {
                imageView.Dispose();
                imageView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (textQRHelp != null)
            {
                textQRHelp.Dispose();
                textQRHelp = null;
            }

            if (TimeoutLabel != null)
            {
                TimeoutLabel.Dispose();
                TimeoutLabel = null;
            }

            if (ToDoLabel != null)
            {
                ToDoLabel.Dispose();
                ToDoLabel = null;
            }

            if (viewState != null)
            {
                viewState.Dispose();
                viewState = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AddToCartButton != null)
            {
                AddToCartButton.Dispose();
                AddToCartButton = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (HotDogImageView != null)
            {
                HotDogImageView.Dispose();
                HotDogImageView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (PriceLabel != null)
            {
                PriceLabel.Dispose();
                PriceLabel = null;
            }

            if (QuantityInput != null)
            {
                QuantityInput.Dispose();
                QuantityInput = null;
            }

            if (ShortDescriptionLabel != null)
            {
                ShortDescriptionLabel.Dispose();
                ShortDescriptionLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (CityLabel != null)
            {
                CityLabel.Dispose();
                CityLabel = null;
            }

            if (DateLabel != null)
            {
                DateLabel.Dispose();
                DateLabel = null;
            }

            if (DescriptionTextView != null)
            {
                DescriptionTextView.Dispose();
                DescriptionTextView = null;
            }

            if (GradeLabel != null)
            {
                GradeLabel.Dispose();
                GradeLabel = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (OwnerLabel != null)
            {
                OwnerLabel.Dispose();
                OwnerLabel = null;
            }

            if (PictureImageView != null)
            {
                PictureImageView.Dispose();
                PictureImageView = null;
            }

            if (PriceLabel != null)
            {
                PriceLabel.Dispose();
                PriceLabel = null;
            }
        }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (NameLabel == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "NameLabel");
     }
     if (NameLabel != null)
     {
         NameLabel.Validate();
     }
     if (Schedule != null)
     {
         Schedule.Validate();
     }
 }
Exemplo n.º 15
0
        public override void DrawName()
        {
            CreateLabel();

            if (NameLabel == null || OwnerLabel == null)
            {
                return;
            }

            NameLabel.Location = new Point(DisplayRectangle.X + (50 - NameLabel.Size.Width) / 2, DisplayRectangle.Y - (42 - NameLabel.Size.Height / 2) + (Dead ? 35 : 8));
            NameLabel.Draw();

            OwnerLabel.Location = new Point(DisplayRectangle.X + (50 - OwnerLabel.Size.Width) / 2, NameLabel.Location.Y + NameLabel.Size.Height - 1);
            OwnerLabel.Draw();
        }
 void ReleaseDesignerOutlets()
 {
     if (BirthdayOccupation != null)
     {
         BirthdayOccupation.Dispose();
         BirthdayOccupation = null;
     }
     if (Email != null)
     {
         Email.Dispose();
         Email = null;
     }
     if (Frequency != null)
     {
         Frequency.Dispose();
         Frequency = null;
     }
     if (FromWhere != null)
     {
         FromWhere.Dispose();
         FromWhere = null;
     }
     if (NameLabel != null)
     {
         NameLabel.Dispose();
         NameLabel = null;
     }
     if (PartiaOkreg != null)
     {
         PartiaOkreg.Dispose();
         PartiaOkreg = null;
     }
     if (PoselImage != null)
     {
         PoselImage.Dispose();
         PoselImage = null;
     }
     if (Telephone != null)
     {
         Telephone.Dispose();
         Telephone = null;
     }
     if (UstawyUchwaly != null)
     {
         UstawyUchwaly.Dispose();
         UstawyUchwaly = null;
     }
 }
Exemplo n.º 17
0
 protected void OnAddButtonClicked(object sender, EventArgs e)
 {
     DoneLabel.Hide();
     NameLabel.Show();
     NameBox.Show();
     TypeLabeld.Show();
     Typebox.Show();
     OwnerLabel.Show();
     OwnerBox.Show();
     AddButton.Hide();
     ViewButton.Hide();
     BackButton.Show();
     DoneButton.Show();
     HoursBox.Show();
     HoursLabel.Show();
 }
Exemplo n.º 18
0
        void SetupMethod()
        {
            AddPlayerButton.Show();
            NameLabel.Show();
            NameField.Show();
            DoneButton.Show();

            CurrentGame.Setup();

            DoneButton.Hide();
            AddPlayerButton.Hide();
            NameLabel.Hide();
            NameField.Hide();
            SetupGameButton.Hide();
            RunGameButton.Show();
        }
 public void VerifyElements()
 {
     BreadCrumbShipBoxDetails.Verify();
     BreadCrumbAllShipBoxCategories.Verify();
     Legend.Verify();
     NameLabel.Verify();
     NameContent.Verify();
     ColumnHeaderId.Verify();
     ColumnHeaderName.Verify();
     ColumnHeaderDetails.Verify();
     Row1Column1.Verify();
     Row1Column2.Verify();
     Row1Column3.Verify();
     _common.VerifyElements();
     Console.WriteLine("Verified Elements on " + _pageName);
 }
Exemplo n.º 20
0
        void ReleaseDesignerOutlets()
        {
            if (ContainerView != null)
            {
                ContainerView.Dispose();
                ContainerView = null;
            }

            if (DimView != null)
            {
                DimView.Dispose();
                DimView = null;
            }

            if (HeaderImageView != null)
            {
                HeaderImageView.Dispose();
                HeaderImageView = null;
            }

            if (HeartImageView != null)
            {
                HeartImageView.Dispose();
                HeartImageView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (RatingImageView != null)
            {
                RatingImageView.Dispose();
                RatingImageView = null;
            }

            if (TypeLabel != null)
            {
                TypeLabel.Dispose();
                TypeLabel = null;
            }
        }
Exemplo n.º 21
0
        void ReleaseDesignerOutlets()
        {
            if (BonusButton != null)
            {
                BonusButton.Dispose();
                BonusButton = null;
            }

            if (DeleteButton != null)
            {
                DeleteButton.Dispose();
                DeleteButton = null;
            }

            if (HandLabel != null)
            {
                HandLabel.Dispose();
                HandLabel = null;
            }

            if (HandView != null)
            {
                HandView.Dispose();
                HandView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (NameView != null)
            {
                NameView.Dispose();
                NameView = null;
            }

            if (SpecialButton != null)
            {
                SpecialButton.Dispose();
                SpecialButton = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (CityLabel != null)
            {
                CityLabel.Dispose();
                CityLabel = null;
            }

            if (DateLabel != null)
            {
                DateLabel.Dispose();
                DateLabel = null;
            }

            if (GradeLabel != null)
            {
                GradeLabel.Dispose();
                GradeLabel = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (OwnerLabel != null)
            {
                OwnerLabel.Dispose();
                OwnerLabel = null;
            }

            if (PriceLabel != null)
            {
                PriceLabel.Dispose();
                PriceLabel = null;
            }

            if (ThumbnailImageView != null)
            {
                ThumbnailImageView.Dispose();
                ThumbnailImageView = null;
            }
        }
Exemplo n.º 23
0
        private Name AssignToNameFromLabels(int[] labels, string[] words)
        {
            if (labels.Length != words.Length)
            {
                throw new Exception("Number of labels does not match number of words.");
            }

            Name name = new Name();

            for (int i = 0; i < labels.Length; i++)
            {
                NameLabel label = (NameLabel)labels[i];
                string    word  = words[i]?.Trim();

                switch (label)
                {
                case NameLabel.Prefix:
                    name.Prefix += string.IsNullOrEmpty(name.Prefix) ? word : " " + word;
                    break;

                case NameLabel.FirstName:
                    name.FirstName += string.IsNullOrEmpty(name.FirstName) ? word : " " + word;
                    break;

                case NameLabel.MiddleName:
                    name.MiddleName += string.IsNullOrEmpty(name.MiddleName) ? word : " " + word;
                    break;

                case NameLabel.LastName:
                    name.LastName += string.IsNullOrEmpty(name.LastName) ? word : " " + word;
                    break;

                case NameLabel.Suffix:
                    name.Suffix += string.IsNullOrEmpty(name.Suffix) ? word : " " + word;
                    break;

                default:
                    throw new Exception($"Label {label} for '{word}' is invalid.");
                }
            }

            return(name);
        }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (NameLabel == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "NameLabel");
     }
     if (ConversationsMigrationSettings != null)
     {
         ConversationsMigrationSettings.Validate();
     }
     if (NameLabel != null)
     {
         NameLabel.Validate();
     }
     if (Schedule != null)
     {
         Schedule.Validate();
     }
 }
Exemplo n.º 25
0
        private IEnumerator Waiting()
        {
            string waitText = "等待抢庄";

            while (_isWaiting)
            {
                NameLabel.Text(string.Format("{0}", waitText));
                yield return(new WaitForSeconds(0.5f));

                NameLabel.Text(string.Format("{0}.", waitText));
                yield return(new WaitForSeconds(0.5f));

                NameLabel.Text(string.Format("{0}..", waitText));
                yield return(new WaitForSeconds(0.5f));

                NameLabel.Text(string.Format("{0}...", waitText));
                yield return(new WaitForSeconds(0.5f));
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ImageView != null)
            {
                ImageView.Dispose();
                ImageView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (UrlLabel != null)
            {
                UrlLabel.Dispose();
                UrlLabel = null;
            }
        }
Exemplo n.º 27
0
        void ReleaseDesignerOutlets()
        {
            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (StatusLabel != null)
            {
                StatusLabel.Dispose();
                StatusLabel = null;
            }

            if (OrderImage != null)
            {
                OrderImage.Dispose();
                OrderImage = null;
            }
        }
Exemplo n.º 28
0
        void ReleaseDesignerOutlets()
        {
            if (AvatorImage != null)
            {
                AvatorImage.Dispose();
                AvatorImage = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
Exemplo n.º 29
0
        void ReleaseDesignerOutlets()
        {
            if (CoatOfArmsLabel != null)
            {
                CoatOfArmsLabel.Dispose();
                CoatOfArmsLabel = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (WordsLabel != null)
            {
                WordsLabel.Dispose();
                WordsLabel = null;
            }
        }
Exemplo n.º 30
0
        void ReleaseDesignerOutlets()
        {
            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }
        }
Exemplo n.º 31
0
        void ReleaseDesignerOutlets()
        {
            if (ContainerView != null)
            {
                ContainerView.Dispose();
                ContainerView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (NameLabelHeightConstraint != null)
            {
                NameLabelHeightConstraint.Dispose();
                NameLabelHeightConstraint = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BornInformationLabel != null)
            {
                BornInformationLabel.Dispose();
                BornInformationLabel = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (PlayedByLabel != null)
            {
                PlayedByLabel.Dispose();
                PlayedByLabel = null;
            }
        }
Exemplo n.º 33
0
        public void DrawName(Point OffSet)
        {
            if (NameLabel == null || NameLabel.IsDisposed)
            {
                CreateLabel();
            }

            NameLabel.BackColor = Color.FromArgb(100, 0, 24, 48);
            NameLabel.Border    = true;
            //NameLabel.OutLine = false;

            if (NameLabel != null)
            {
                Size S = PrimaryLibrary.GetSize(ImageIndex);
                NameLabel.Location = new Point(
                    DisplayRectangle.X + OffSet.X + (DisplayRectangle.Width - NameLabel.Size.Width) / 2,
                    DisplayRectangle.Y + OffSet.Y + (DisplayRectangle.Height - NameLabel.Size.Height) / 2 - 20);
                NameLabel.Draw();
            }
        }
Exemplo n.º 34
0
        public override void DrawName()
        {
            if (NameLabel == null || NameLabel.IsDisposed)
            {
                CreateLabel();
            }

            NameLabel.BackColor = Color.Transparent;
            NameLabel.Border    = false;
            NameLabel.OutLine   = true;

            if (NameLabel != null)
            {
                Size S = PrimaryLibrary.GetSize(ImageIndex);
                NameLabel.Location = new Point(
                    DisplayRectangle.X + (DisplayRectangle.Width - NameLabel.Size.Width) / 2,
                    DisplayRectangle.Y + (DisplayRectangle.Height - NameLabel.Size.Height) / 2 - 20);
                NameLabel.Draw();
            }
        }
 public override void VerifyContentExists()
 {
     NameLabel.Wait(3);
     NameLabel.Text = Data.Name;
     Assert.AreEqual(Data.Name, NameLabel.Text.Trim(), "NameLabel does not match.");
     PublisherLabel.Text = Data.Publisher;
     Assert.AreEqual(Data.Publisher, PublisherLabel.Text.Trim(), "PublisherLabel does not match.");
     KeywordsLabel.Text = Data.Keyword;
     Assert.AreEqual(Data.Keyword, KeywordsLabel.Text.Trim(), "KeywordsLabel does not match.");
     AdditionalItemIdentifierLabel.Text = Data.AdditionalItemIdentifier;
     Assert.AreEqual(Data.AdditionalItemIdentifier, AdditionalItemIdentifierLabel.Text.Trim(), "AdditionalItemIdentifierLabel does not match.");
     BatchLabel.Text = Data.Batch;
     Assert.AreEqual(Data.Batch, BatchLabel.Text.Trim(), "BatchLabel does not match.");
     CourseIdLabel.Text = Data.CourseId;
     Assert.AreEqual(Data.CourseId, CourseIdLabel.Text.Trim(), "CourseIdLabel does not match.");
     ItemCategoryLabel.Text = Data.ItemCategory;
     Assert.AreEqual(Data.ItemCategory, ItemCategoryLabel.Text.Trim(), "ItemCategoryLabel does not match.");
     YearLabel.Text = Data.Year;
     Assert.AreEqual(Data.Year, YearLabel.Text.Trim(), "YearLabel does not match.");
 }
        void ReleaseDesignerOutlets()
        {
            if (EmailLabel != null)
            {
                EmailLabel.Dispose();
                EmailLabel = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (NoInternetConnection != null)
            {
                NoInternetConnection.Dispose();
                NoInternetConnection = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (MainImage != null)
            {
                MainImage.Dispose();
                MainImage = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (PriceLabel != null)
            {
                PriceLabel.Dispose();
                PriceLabel = null;
            }
        }
Exemplo n.º 38
0
        public void TitleLengthTest()
        {
            string testValueTooLong = "The Right-Honourable, His Most-High-Excellency";
            string testValueExpected = "SMITH, John (The Right-Honourable, His Most-H...)";

            NameLabel nameLabel = new NameLabel();
            nameLabel.Title = testValueTooLong;
            nameLabel.GivenName = "John";
            nameLabel.FamilyName = "Smith";
            Assert.AreEqual<string>(testValueExpected, nameLabel.DisplayValue, "Title should have been truncated in DisplayValue");
        }
Exemplo n.º 39
0
        public void DisplayValueMaximumLengthTest()
        {
            NameLabel nameLabel = new NameLabel();
            nameLabel.FamilyName = "VeryLongFamilyName9012345678901234567890";

            nameLabel.GivenName = "VeryLongGivenName89012345678901234567890";
            nameLabel.Title = "VeryLongTitle8901234567890123456789";
            Assert.AreEqual(
                        nameLabel.DisplayValue,
                        "VERYLONGFAMILYNAME9012345678901234567890, VeryLongGivenName89012345678901234567890 (VeryLongTitle8901234567890123456789)",
                        "Max length DisplayValue not as expected");
        }
Exemplo n.º 40
0
        public void DisplayValueTruncationTest()
        {
            NameLabel nameLabel = new NameLabel();
            nameLabel.FamilyName = "VeryLongFamilyName9012345678901234567890ThisShouldBeTruncated";

            nameLabel.GivenName = "VeryLongGivenName89012345678901234567890ThisShouldBeTruncated";
            nameLabel.Title = "VeryLongTitle8901234567890123456789ThisShouldBeTruncated";
            Assert.AreEqual(
                        nameLabel.DisplayValue, 
                        "VERYLONGFAMILYNAME9012345678901234567..., VeryLongGivenName89012345678901234567... (VeryLongTitle8901234567890123456...)", 
                        "DisplayValue not truncated as expected");
        }
Exemplo n.º 41
0
        public void TitleTest()
        {
            string testValue = "(Mr)";

            NameLabel nameLabel = new NameLabel();
            Assert.AreEqual<string>(string.Empty, nameLabel.Title, "Expected Title to initially be string.Empty");

            nameLabel.Title = testValue;
            Assert.AreEqual<string>(testValue, nameLabel.Title, "Title property not set as expected");
        }
Exemplo n.º 42
0
        public void DisplayValueTest()
        {
            string testFamilyNameInput = "Evans";
            string testGivenName = "Jane";
            string testTitle = "Ms.";

            string testFamilyNameOutput = "EVANS";

            string testLastFirstEntryOutput = testFamilyNameOutput + ", " + testGivenName;
            string testFullEntryOutput = testLastFirstEntryOutput + " (" + testTitle + ")";
            string testFirstTitleEntryOutput = testGivenName + " (" + testTitle + ")";

            NameLabel nameLabel = new NameLabel();

            Assert.AreEqual<string>(string.Empty, nameLabel.DisplayValue, "Expected display value to initially be string.Empty");

            nameLabel.FamilyName = testFamilyNameInput;
            Assert.AreEqual<string>(testFamilyNameOutput, nameLabel.DisplayValue, string.Format(CultureInfo.InvariantCulture, "Expected display value to be '{0}'", testFamilyNameOutput));

            nameLabel.GivenName = testGivenName;
            Assert.AreEqual<string>(testLastFirstEntryOutput, nameLabel.DisplayValue, string.Format(CultureInfo.InvariantCulture, "Expected display value to be '{0}'", testLastFirstEntryOutput));

            nameLabel.Title = testTitle;
            Assert.AreEqual<string>(testFullEntryOutput, nameLabel.DisplayValue, string.Format(CultureInfo.InvariantCulture, "Expected display value to be '{0}'", testFullEntryOutput));

            nameLabel.FamilyName = string.Empty;
            Assert.AreEqual<string>(testFirstTitleEntryOutput, nameLabel.DisplayValue, string.Format(CultureInfo.InvariantCulture, "Expected display value to be '{0}'", testFirstTitleEntryOutput));

            nameLabel.GivenName = string.Empty;
            Assert.AreEqual<string>(string.Empty, nameLabel.DisplayValue, "Expected display value to be string.Empty");

            nameLabel.GivenName = testGivenName;
            nameLabel.Title = string.Empty;
            Assert.AreEqual<string>(testGivenName, nameLabel.DisplayValue, string.Format(CultureInfo.InvariantCulture, "Expected display value to be '{0}'", testGivenName));
        }
Exemplo n.º 43
0
        public void GivenNameLengthTest()
        {
            string testValueTooLong = "Susan Kathleen Mary Bridgette Concepta Caitlin Margaret Theresa";
            string testValueExpected = "Susan Kathleen Mary Bridgette Concept...";

            NameLabel nameLabel = new NameLabel();
            nameLabel.GivenName = testValueTooLong;
            Assert.AreEqual<string>(testValueExpected, nameLabel.DisplayValue, "GivenName should have been truncated in DisplayValue");
        }