NUnit.Framework.Assert.AreEqual(int, int)

Here are the examples of the csharp api class NUnit.Framework.Assert.AreEqual(int, int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: MvbaCore
Source File: NotificationTests_Add.cs
View license
[Test]
			public void Should_not_overwrite_any_NotificationMessages_that_already_exist()
			{
				var source = new Notification<string>();
				source.Add(new NotificationMessage(NotificationSeverity.Warning, ""));

				var destination = new Notification();
				destination.Add(new NotificationMessage(NotificationSeverity.Error, ""));
				destination.Add(source);

				Assert.AreEqual(2, destination.Messages.Count());
			}

2. Example

Project: MvbaCore
Source File: NotificationTests_Add.cs
View license
[Test]
			public void Should_succeed_if_the_Notification_being_added_has_no_messages()
			{
				var source = new Notification();
				var destination = new Notification();
				destination.Add(source);
				Assert.AreEqual(0, destination.Messages.Count());
			}

3. Example

Project: MvbaCore
Source File: NotificationTests_Add.cs
View license
[Test]
			public void Should_succeed_if_the_Notification_being_added_has_no_messages()
			{
				var source = new Notification<string>();
				var destination = new Notification();
				destination.Add(source);
				Assert.AreEqual(0, destination.Messages.Count());
			}

4. Example

Project: MvbaCore
Source File: NotificationTests_Add.cs
View license
[Test]
			public void Should_not_add_any_message_that_is_identical_to_a_message_already_contained_by_the_Notification()
			{
				var source = new Notification();
				source.Add(new NotificationMessage(NotificationSeverity.Warning, ""));
				source.Add(new NotificationMessage(NotificationSeverity.Error, "dup"));

				var destination = new Notification();
				destination.Add(new NotificationMessage(NotificationSeverity.Error, "dup"));
				destination.Add(source);

				Assert.AreEqual(2, destination.Messages.Count());
			}

5. Example

Project: MvbaCore
Source File: NotificationTests_Add.cs
View license
[Test]
			public void Should_not_overwrite_any_NotificationMessages_that_already_exist()
			{
				var source = new Notification();
				source.Add(new NotificationMessage(NotificationSeverity.Warning, ""));

				var destination = new Notification();
				destination.Add(new NotificationMessage(NotificationSeverity.Error, ""));
				destination.Add(source);

				Assert.AreEqual(2, destination.Messages.Count());
			}

6. Example

Project: MvbaCore
Source File: NotificationTests_Add.cs
View license
[Test]
			public void Should_not_add_any_message_that_is_identical_to_a_message_already_contained_by_the_Notification()
			{
				var source = new Notification<string>();
				source.Add(new NotificationMessage(NotificationSeverity.Warning, ""));
				source.Add(new NotificationMessage(NotificationSeverity.Error, "dup"));

				var destination = new Notification();
				destination.Add(new NotificationMessage(NotificationSeverity.Error, "dup"));
				destination.Add(source);

				Assert.AreEqual(2, destination.Messages.Count());
			}

7. Example

Project: FastCgiNet
Source File: EndRequestRecordTests.cs
View license
[Test]
		public void SetAndGetNonNegativeApplicationStatus()
        {
			var rec = new EndRequestRecord(1);

            for (int status = 20000000; status < 20000010; ++status)
            {
                rec.AppStatus = status;
                Assert.AreEqual(status, rec.AppStatus);
            }
		}

8. Example

Project: FastCgiNet
Source File: EndRequestRecordTests.cs
View license
[Test]
        public void SetAndGetNegativeApplicationStatus()
        {
            var rec = new EndRequestRecord(1);
            
            for (int status = -10; status < 0; ++status)
            {
                rec.AppStatus = status;
                Assert.AreEqual(status, rec.AppStatus);
            }
        }

9. Example

Project: Fos
Source File: StdoutStream.cs
View license
[Test]
		public void OnFirstWriteAndOnStreamFillEvents()
		{
            using (var server = this.Ge/n ..... /n //View Source file for more details /n }

10. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void FilterByTypeEqual()
        {
            IList<PersistableItem2> items = finder.Where.Type.Eq(typeof(PersistableItem2)).Select<PersistableItem2>();
            Assert.AreEqual(3, items.Count);
            EnumerableAssert.Contains(items, item1);
            EnumerableAssert.Contains(items, item2);
            EnumerableAssert.Contains(items, item3);
        }

11. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void IntInDetailCollection()
        {
            IList<ContentItem> items = finder.Where.Detail("DetailCollection").Gt(2000).Select();
            Assert.AreEqual(2, items.Count);
        }

12. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void LinkInDetailCollection()
        {
            IList<ContentItem> items = finder.Where.Detail("DetailCollection").Eq(startPage).Select();
            Assert.AreEqual(3, items.Count);
        }

13. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void TwoItems_ByNameOrTitle()
        {
            IList<ContentItem> items = finder.Where.Name.Eq("root").Or.Title.Eq("start page").Select();
            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

14. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void AnyEnumDetail()
        {
            IList<ContentItem> items = finder.Where.Detail().Eq(AppDomainManagerInitializationOptions.RegisterWithHost).Select();
            Assert.AreEqual(1, items.Count);
            EnumerableAssert.Contains(items, startPage);
        }

15. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void All()
        {
            IList<ContentItem> items = finder.All.Select();

            Assert.AreEqual(5, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

16. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CantFindPropertyAndDetailWhenOnlyDetailIsThere()
        {
            IList<ContentItem> items = finder.Where.Title.Eq("not the root")
                .And.Detail("StringDetail").Eq("just a string")
                .Select();
            Assert.AreEqual(0, items.Count);
        }

17. Example

Project: n2cms
Source File: ParentFilterTests.cs
View license
[Test]
        public void CanFilterByParentItem()
        {
            AncestorFilter filter = new AncestorFilter(child1);
            filter.Filter(allItems);
            Assert.AreEqual(3, allItems.Count);
        }

18. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void BoolInDetailCollection()
        {
            IList<ContentItem> items = finder.Where.Detail("DetailCollection").Eq(true).Select();
            Assert.AreEqual(3, items.Count);
        }

19. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void ByProperty_State_EqualsPublished()
        {
            IList<ContentItem> items = finder.Where.State.Eq(ContentState.Published).Select();
            Assert.AreEqual(5, items.Count);
        }

20. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void ByPropertySavedBy()
        {
            IList<ContentItem> items = finder.Where.SavedBy.Eq(rootItem.SavedBy).Select();
            Assert.AreEqual(5, items.Count);
        }

21. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CanCountAnyStringDetail()
        {
            int count = finder.Where.Detail().Eq("just a string").Count();
            Assert.AreEqual(2, count);
        }

22. Example

Project: n2cms
Source File: EditableExplorerTests.cs
View license
[Test]
        public void FindsDetailDefinedOnClass()
        {
            IList<IEditable> editables = explorer.Find<IEditable>(typeof(Items.DefinitionTwoColumnPage));
            Assert.AreEqual(2, editables.Count);
            TypeAssert.AreEqual(typeof(N2.Details.WithEditableTitleAttribute), editables[0]);
            TypeAssert.AreEqual(typeof(N2.Details.WithEditableNameAttribute), editables[1]);
        }

23. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void AnyStringDetailWithLike()
        {
            IList<ContentItem> items = finder.Where.Detail().Like("just %").Select();
            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

24. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CantFindDetailAndDetailWhenOnlyOneIsThere()
        {
            IList<ContentItem> items = finder.Where.Detail("StringDetail").Eq("just a string")
                .And.Detail("StringDetail").Eq("min mollgan str?ng")
                .Select();
            Assert.AreEqual(0, items.Count);
        }

25. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CanSelectByDetailIn()
        {
            IList<ContentItem> items = finder.Where.Detail().In(43, 45).Select();
            
            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

26. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void WithNoneFilteredAndMaxResults()
        {
            IList<ContentItem> items = finder.All
                .Filters(new NullFilter())
                .MaxResults(2)
                .OrderBy.ID.Asc.Select();

            Assert.AreEqual(2, items.Count);
        }

27. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void WithFilterAndHugeMaxResults()
        {
            IList<ContentItem> items = finder.All
                .Filters(new CountFilter(1, 2))
                .MaxResults(200)
                .OrderBy.ID.Asc.Select();

            Assert.AreEqual(2, items.Count);
        }

28. Example

Project: n2cms
Source File: ParentFilterTests.cs
View license
[TestCase(1, 12)]
        [TestCase(2, 3)]
        [TestCase(3, 3)]
        [TestCase(4, 3)]
        [TestCase(5, 0)]
        public void CanFilterByParentID(int parentID, int expectedCount)
        {
            AncestorFilter filter = new AncestorFilter(parentID);
            filter.Filter(allItems);
            Assert.AreEqual(expectedCount, allItems.Count);
        }

29. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CanSelectByPropertyNameIn()
        {
            IList<ContentItem> items = finder.Where.Name.In(rootItem.Name, startPage.Name).Select();

            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

30. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void WithNoneFilteredAndHugeMaxResults()
        {
            IList<ContentItem> items = finder.All
                .Filters(new NullFilter())
                .MaxResults(200)
                .OrderBy.ID.Asc.Select();

            Assert.AreEqual(5, items.Count);
        }

31. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CantFindPropertyAndDetailWhenOnlyPropertyIsThere()
        {
            IList<ContentItem> items = finder.Where.Title.Eq("root")
                .And.Detail("StringDetail").Eq("min mollgan str?ng")
                .Select();
            Assert.AreEqual(0, items.Count);
        }

32. Example

Project: n2cms
Source File: EditableExplorerTests.cs
View license
[Test]
        public void FindsContainers()
        {
            IList<IEditableContainer> containers = explorer.Find<IEditableContainer>(typeof(Items.DefinitionTextPage));
            Assert.AreEqual(2, containers.Count);
        }

33. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void StringInDetailCollection()
        {
            IList<ContentItem> items = finder.Where.Detail("DetailCollection").Like("string in a collection %").Select();
            Assert.AreEqual(3, items.Count);
        }

34. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void FilterByTypeNotEqual()
        {
            IList<ContentItem> items = finder.Where.Type.NotEq(typeof(PersistableItem2)).Select();
            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

35. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void FilterByTypeEqual2()
        {
            IList<PersistableItem> items = finder.Where.Type.Eq(typeof(PersistableItem)).Select<PersistableItem>();
            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

36. Example

Project: n2cms
Source File: EditableExplorerTests.cs
View license
[Test]
        public void FindsDetailsDefinedOnClassAndOnProperty()
        {
            IList<IEditable> editables = explorer.Find<IEditable>(typeof(Items.DefinitionTextPage));
            Assert.AreEqual(3, editables.Count);
        }

37. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CanSelectByClassIn()
        {
            IList<ContentItem> items = finder.Where.Type.In(typeof(PersistableItem2), typeof(PersistableItem)).Select();
            
            Assert.AreEqual(5, items.Count);
        }

38. Example

Project: n2cms
Source File: EditableExplorerTests.cs
View license
[Test]
        public void RedefinedContainerIsntDuplicated()
        {
            IList<IEditableContainer> containers = explorer.Find<IEditableContainer>(typeof(Items.DefinitionNewsPage));
            Assert.AreEqual(2, containers.Count);
        }

39. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void DateInDetailCollection()
        {
            IList<ContentItem> items = finder.Where.Detail("DetailCollection").Le(new DateTime(2011, 1, 1)).Select();
            Assert.AreEqual(2, items.Count);
        }

40. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CanCountByTypeEqual()
        {
            int count = finder.Where.Type.Eq(typeof (PersistableItem2)).Count();
            Assert.AreEqual(3, count);
        }

41. Example

Project: n2cms
Source File: DefinitionTests.cs
View license
[Test]
        public void TextPage_Has2InheritedEditables_AndOneAddedToProperty()
        {
            ItemDefinition definition = definitions.GetDefinition(typeof (DefinitionTextPage));
            IList<IEditable> editables = definition.Editables;
            Assert.AreEqual(3, editables.Count);
        }

42. Example

Project: n2cms
Source File: ContentItemTests.cs
View license
[Test]
        public void CanClone_Item_WithObjectDetail()
        {
            ContentItem root = CreateOneItem<AnItem>(1, "root", null);
            X originalValue = new X { Number = 123};
            root["TheDetail"] = originalValue;
            ContentItem clonedRoot = root.Clone(false);

            X clonedValue = (X) clonedRoot["TheDetail"];
            Assert.AreEqual(clonedValue.Number, originalValue.Number);
        }

43. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void StringDetailWithLike2()
        {
            IList<ContentItem> items = finder.Where.Detail("StringDetail").Like("% string").Select();
            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

44. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void AnyStringDetail()
        {
            IList<ContentItem> items = finder.Where.Detail().Eq("just a string").Select();
            Assert.AreEqual(2, items.Count);
            EnumerableAssert.Contains(items, rootItem);
            EnumerableAssert.Contains(items, startPage);
        }

45. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CanCountAll()
        {
            int count = finder.All.Count();
            Assert.AreEqual(5, count);
        }

46. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void FilterByTypeAndName()
        {
            IList<PersistableItem2> items = finder
                .Where.Type.Eq(typeof(PersistableItem2))
                .And.Name.Eq("item1")
                .Select<PersistableItem2>();
            Assert.AreEqual(1, items.Count);
            EnumerableAssert.Contains(items, item1);
        }

47. Example

Project: n2cms
Source File: ItemFinderTests.cs
View license
[Test]
        public void CanCountByPropertyTitle()
        {
            int count = finder.Where.Title.Eq(rootItem.Title).Count();
            Assert.AreEqual(1, count);
        }

48. Example

View license
[QueryOnly]
        public override MostSimple AnActionReturnsObjectWithParameterAnnotatedQueryOnly(int parm1) {
            Assert.AreEqual(101, parm1);
            return Container.Instances<MostSimple>().First();
        }

49. Example

Project: NakedObjectsFramework
Source File: WithAction.cs
View license
[QueryOnly]
        public virtual MostSimple AnActionReturnsObjectWithParameterAnnotatedQueryOnly(int parm1) {
            Assert.AreEqual(101, parm1);
            return Container.Instances<MostSimple>().First();
        }

50. Example

Project: nantcontrib
Source File: VersionTaskTest.cs
View license
[Test]
        public void TestVersionNumberToShort() {
            Version version = new Version("1.1.2");
            Assert.AreEqual(-1, version.Revision);
        }