public void FillInFieldWith(FieldEnum fieldName, string text) { MailPage mailPage = new MailPage(); if (text == "default") { MessageEntity message = MessageEntity.GetDefaultMessageInfo(); mailPage.FillingDefaultEmailForm(message); } else { switch (fieldName) { case FieldEnum.Reciever: { mailPage.FillInRecieverField(text); break; } case FieldEnum.Theme: { mailPage.FillInThemeField(text); break; } case FieldEnum.Body: { mailPage.FillInBodyOfMessage(text); break; } default: { throw new NoSuchElementException ($"Field with '{fieldName}' name is not found"); } } } }