Пример #1
0
        public void Search_WithDisplayNameConstraint_DontMatchOtherValue()
        {
            var expected = AbstractRoleDefinition.FindAll().AsEnumerable().ToArray();

            Assert.That(expected.Length, Is.EqualTo(2));

            var actual = _searchService.Search(null, _property, CreateSecurityManagerSearchArguments("QualityManager"));

            Assert.That(actual.Length, Is.EqualTo(1));
        }
Пример #2
0
        public void Search()
        {
            var expected = AbstractRoleDefinition.FindAll().ToArray();

            Assert.That(expected, Is.Not.Empty);

            IBusinessObject[] actual = _searchService.Search(null, _property, CreateSecurityManagerSearchArguments(null));

            Assert.That(actual, Is.EqualTo(expected));
        }
Пример #3
0
        public void Search_WithDisplayNameConstraint_FindDisplayNameCaseInsensitive()
        {
            var expected = AbstractRoleDefinition.FindAll().AsEnumerable().Where(r => r.DisplayName.Contains("QualityManager")).ToArray();

            Assert.That(expected.Length, Is.EqualTo(1));

            var actual = _searchService.Search(null, _property, CreateSecurityManagerSearchArguments("qualitymanager"));

            Assert.That(actual, Is.EquivalentTo(expected));
        }
Пример #4
0
        public void FindAll_TwoFound()
        {
            var result = AbstractRoleDefinition.FindAll();

            Assert.That(result.Count, Is.EqualTo(2));
            for (int i = 0; i < result.Count; i++)
            {
                AbstractRoleDefinition abstractRole = result[i];
                Assert.AreEqual(i, abstractRole.Index, "Wrong Index.");
            }
        }
Пример #5
0
    public void FindAll_EmptyResult ()
    {
      DomainObjectCollection result = AbstractRoleDefinition.FindAll();

      Assert.That (result.Count, Is.EqualTo (0));
    }