/* Что такое GLAccount? Что-то вроде структурного подразделения внутри компании. Ни на какие бизнес процессы влияния не оказывает, используется просто как классификатор. Number of Expenditures - это как раз случай использования его как классификатора. Из БД достаются все ExpenditureCategory у которых GLAccountId = GLAccount.Id. На эту таблицу также ссылается Client.GLAccountId. Смысл в обоих случаях одинаковый, клиенты (Client) с которыми работает подразделение GLAccount "1й отдел" или должности (ExpCat) которые есть в подразделении GLAccount "1й отдел" */ using Microsoft.VisualStudio.TestTools.UnitTesting; using System; namespace Prevu { [TestClass] public class GLAccounts : BaseTest { #region Initialization & CleanUp [ClassInitialize] public static void ClassInitialize(TestContext TestContext) { BaseTest.ClassInitialize(TestContext); } [ClassCleanup] public static void ClassCleanup() { BaseTest.ClassCleanup(); } #endregion Initialization & CleanUp [TestMethod, TestCategory("Smoke Test"), TestCategory("GL Accounts"), Timeout(testTimeout)] [TestProperty("Create GL Account", "1. Open the GL Accounts page
2. Click 'Add GL Account' button
3. Fill the following fields:
Account Name
Account Number
4. Click Save
5. Find created GL account and check stored data")] public void CreateGLAccount() { Assert.IsTrue(loginPage.SignInAdmin()); Assert.IsTrue(glAccountsPage.OpenGLAccounts()); string id = ""; string glAccountName = string.Format("Test GL Account {0}", tempId); string glAccountNumber = tempId; Assert.IsTrue(glAccountsPage.CreateGLAccount(glAccountName, glAccountNumber, out id)); Assert.IsFalse(string.IsNullOrEmpty(id)); Assert.IsTrue(glAccountsPage.CheckGLAccount(id, glAccountName, glAccountNumber)); } [TestMethod, TestCategory("Smoke Test"), TestCategory("GL Accounts"), Timeout(testTimeout)] [TestProperty("Delete GL Account", "1. Find a GL account
2. Click Delete button
3. Check warning message:
You are about to delete the < Account Name >.Are you sure you want to delete it?
4. Click Delete button
5. Make sure that GL account is deleted")] public void DeleteGLAccount() { Assert.IsTrue(loginPage.SignInAdmin()); Assert.IsTrue(glAccountsPage.OpenGLAccounts()); string id = ""; string glAccountName = string.Format("Test GL Account {0}d", tempId); string glAccountNumber = string.Format("{0}d", tempId); Assert.IsTrue(glAccountsPage.CreateGLAccount(glAccountName, glAccountNumber, out id)); Assert.IsFalse(string.IsNullOrEmpty(id)); Assert.IsTrue(glAccountsPage.DeleteGLAccount(id, glAccountName)); } [TestMethod, TestCategory("Smoke Test"), TestCategory("GL Accounts"), Timeout(testTimeout)] [TestProperty("Edit GL Account", "1. Find a GL account
2. Click Edit button
3. Change the following fields:
Account Name
Account Number
4. Click Save
5. Open the GL account details
6. Check edited field values")] public void EditGLAccount() { Assert.IsTrue(loginPage.SignInAdmin()); Assert.IsTrue(glAccountsPage.OpenGLAccounts()); string id = ""; string glAccountName = string.Format("Test GL Account {0}", tempId); string glAccountNumber = tempId; Assert.IsTrue(glAccountsPage.CreateGLAccount(glAccountName, glAccountNumber, out id)); Assert.IsFalse(string.IsNullOrEmpty(id)); glAccountName = string.Format("Test GL Account {0} E", tempId); glAccountNumber = string.Format("{0}-1", tempId); Assert.IsTrue(glAccountsPage.EditGLAccount(id, glAccountName, glAccountNumber)); } } }