public void TestActivateKeyword()
 {
     _table = Constants.DropdownTable.Keyword;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     int keyid = (from keys in _dc.Keywords
                  where keys.KeywordValue == _testValue
                  select keys.KeywordID).FirstOrDefault();
     _ddc.editEntryStatus(_table, keyid, true);
     Keyword toCheck = (from u in _dc.Keywords
                        where u.KeywordID == keyid
                        select u).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.KeywordValue.Trim(), _testValue);
     Assert.True(toCheck.Active);
 }
 public void TestGetEmptyMatchingKeyword()
 {
     _table = Constants.DropdownTable.Keyword;
     List<string> list = _ddc.getMatchingKeywords(_testValue);
     Assert.NotNull(list);
     Assert.False(list.Contains(_testValue));
 }
 public void TestEditUserGroup()
 {
     _table = Constants.DropdownTable.UserGroup;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     int ugid = (from ugs in _dc.UserGroups
                 where ugs.Value == _testValue && ugs.Code == _testCode
                 select ugs.GroupID).FirstOrDefault();
     _ddc.editEntry(_table, ugid, _editCode, _editValue, true);
     UserGroup toCheck = (from u in _dc.UserGroups
                          where u.GroupID == ugid
                          select u).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _editValue);
     Assert.AreEqual(toCheck.Code.Trim(), _editCode);
     Assert.True(toCheck.Active);
 }
 public void TestEditRequestorType()
 {
     _table = Constants.DropdownTable.RequestorType;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     int rtid = (from rts in _dc.RequestorTypes
                 where rts.Value == _testValue && rts.Code == _testCode
                 select rts.RequestorTypeID).FirstOrDefault();
     _ddc.editEntry(_table, rtid, _editCode, _editValue, true);
     RequestorType toCheck = (from u in _dc.RequestorTypes
                              where u.RequestorTypeID == rtid
                              select u).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _editValue);
     Assert.AreEqual(toCheck.Code.Trim(), _editCode);
     Assert.True(toCheck.Active);
 }
 public void TestDeactiveTumourGroup()
 {
     _table = Constants.DropdownTable.TumourGroup;
     _ddc.createEntry(_table, _testCode, _testValue, true);
     int tgid = (from tgs in _dc.TumourGroups
                 where tgs.Value == _testValue
                 select tgs.TumourGroupID).FirstOrDefault();
     _ddc.editEntryStatus(_table, tgid, false);
     TumourGroup toCheck = (from u in _dc.TumourGroups
                            where u.TumourGroupID == tgid
                            select u).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.False(toCheck.Active);
 }
 public void TestDeactiveRegion()
 {
     _table = Constants.DropdownTable.Region;
     _ddc.createEntry(_table, _testCode, _testValue, true);
     int regid = (from regs in _dc.Regions
                  where regs.Value == _testValue
                  select regs.RegionID).FirstOrDefault();
     _ddc.editEntryStatus(_table, regid, false);
     Region toCheck = (from u in _dc.Regions
                       where u.RegionID == regid
                       select u).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.False(toCheck.Active);
 }
 public void TestAddQuestionTypeEntity()
 {
     _table = Constants.DropdownTable.QuestionType;
     _de = new DropdownEntry(_testCode, _testValue);
     _ddc.addEntry(_table, _de);
     QuestionType toCheck = (from qts in _dc.QuestionTypes
                             where qts.Value == _testValue
                             select qts).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.False(toCheck.Active);
 }
 public void TestCreateInactiveKeyword()
 {
     _table = Constants.DropdownTable.Keyword;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     Keyword toCheck = (from keys in _dc.Keywords
                        where keys.KeywordValue == _testValue
                        select keys).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.KeywordValue.Trim(), _testValue);
     Assert.False(toCheck.Active);
 }
 public void TestCreateActiveRegion()
 {
     _table = Constants.DropdownTable.Region;
     _ddc.createEntry(_table, _testCode, _testValue, true);
     Region toCheck = (from regs in _dc.Regions
                       where regs.Value == _testValue
                       select regs).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.True(toCheck.Active);
 }
 public void TestCreateActiveTumourGroup()
 {
     _table = Constants.DropdownTable.TumourGroup;
     _ddc.createEntry(_table, _testCode, _testValue, true);
     TumourGroup toCheck = (from tgs in _dc.TumourGroups
                            where tgs.Value == _testValue
                            select tgs).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.True(toCheck.Active);
 }
 public void TestCreateActiveQuestionType()
 {
     _table = Constants.DropdownTable.QuestionType;
     _ddc.createEntry(_table, _testCode, _testValue, true);
     QuestionType toCheck = (from qts in _dc.QuestionTypes
                             where qts.Value == _testValue
                             select qts).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.True(toCheck.Active);
 }
 public void TestAddUserGroupEntity()
 {
     _table = Constants.DropdownTable.UserGroup;
     _de = new DropdownEntry(_testCode, _testValue);
     _ddc.addEntry(_table, _de);
     UserGroup toCheck = (from ugs in _dc.UserGroups
                          where ugs.Value == _testValue
                          select ugs).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.False(toCheck.Active);
 }
 public void TestAddRegionEntity()
 {
     _table = Constants.DropdownTable.Region;
     _de = new DropdownEntry(_testCode, _testValue);
     _ddc.addEntry(_table, _de);
     Region toCheck = (from regs in _dc.Regions
                       where regs.Value == _testValue
                       select regs).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.False(toCheck.Active);
 }
 public void TestGetInactiveEntries(Constants.DropdownTable table)
 {
     _table = table;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     List<DropdownEntry> list = _ddc.getEntries(_table, false);
     DropdownEntry toCheck = (from keys in list
                              where keys.value == _testValue
                              select keys).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.value.Trim(), _testValue);
     Assert.False(toCheck.active);
 }
 public void TestCreateInactiveRequestorType()
 {
     _table = Constants.DropdownTable.RequestorType;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     RequestorType toCheck = (from rts in _dc.RequestorTypes
                              where rts.Value == _testValue
                              select rts).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.False(toCheck.Active);
 }
 public void TestGetMatchingKeyword()
 {
     _table = Constants.DropdownTable.Keyword;
     _ddc.createEntry(_table, _testCode, _testValue, true);
     List<string> list = _ddc.getMatchingKeywords(_testValue);
     Assert.NotNull(list);
     Assert.True(list.Contains(_testValue));
 }
 public void TestCreateInactiveUserGroup()
 {
     _table = Constants.DropdownTable.UserGroup;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     UserGroup toCheck = (from ugs in _dc.UserGroups
                          where ugs.Value == _testValue
                          select ugs).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.AreEqual(toCheck.Code.Trim(), _testCode);
     Assert.False(toCheck.Active);
 }
 public void TestActivateQuestionType()
 {
     _table = Constants.DropdownTable.QuestionType;
     _ddc.createEntry(_table, _testCode, _testValue, false);
     int qtid = (from qts in _dc.QuestionTypes
                 where qts.Value == _testValue
                 select qts.QuestionTypeID).FirstOrDefault();
     _ddc.editEntryStatus(_table, qtid, true);
     QuestionType toCheck = (from u in _dc.QuestionTypes
                             where u.QuestionTypeID == qtid
                             select u).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.Value.Trim(), _testValue);
     Assert.True(toCheck.Active);
 }
 public void TestAddKeywordEntity()
 {
     _table = Constants.DropdownTable.Keyword;
     _de = new DropdownEntry(_testCode, _testValue);
     _ddc.addEntry(_table, _de);
     Keyword toCheck = (from keys in _dc.Keywords
                        where keys.KeywordValue == _testValue
                        select keys).FirstOrDefault();
     Assert.NotNull(toCheck);
     Assert.AreEqual(toCheck.KeywordValue.Trim(), _testValue);
     Assert.False(toCheck.Active);
 }