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

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

200 Examples 7

1. Example

Project: BetterCMS
Source File: FilesApiTests.cs
View license
[Test]
        public void Should_CRUD_File_Successfully()
        {
            Events.MediaManager/n ..... /n //View Source file for more details /n }

2. Example

Project: BetterCMS
Source File: FoldersApiTests.cs
View license
[Test]
        public void Should_CRUD_Folder_Successfully()
        {
            // Attach to events.
            Events.MediaManagerEvents.Instance.MediaFolderCreated += Instance_EntityCreated;
            Events.MediaManagerEvents.Instance.MediaFolderUpdated += Instance_EntityUpdated;
            Events.MediaManagerEvents.Instance.MediaFolderDeleted += Instance_EntityDeleted;
            Events.MediaManagerEvents.Instance.MediaArchived += Instance_MediaArchived;
            Events.MediaManagerEvents.Instance.MediaUnarchived += Instance_MediaUnarchived;

            RunApiActionInTransaction((api, session) =>
                Run(session, api.Media.Folders.Post, api.Media.Folder.Get, api.Media.Folder.Put, api.Media.Folder.Delete));

            Assert.AreEqual(1, archivedMediaEventCount, "Archived media events fired count");
            Assert.AreEqual(1, unarchivedMediaEventCount, "Unarchived media events fired count");

            // Detach from events.
            Events.MediaManagerEvents.Instance.MediaFolderCreated -= Instance_EntityCreated;
            Events.MediaManagerEvents.Instance.MediaFolderUpdated -= Instance_EntityUpdated;
            Events.MediaManagerEvents.Instance.MediaFolderDeleted -= Instance_EntityDeleted;
            Events.MediaManagerEvents.Instance.MediaArchived -= Instance_MediaArchived;
            Events.MediaManagerEvents.Instance.MediaUnarchived -= Instance_MediaUnarchived;
        }

3. Example

Project: BetterCMS
Source File: ImagesApiTests.cs
View license
[Test]
        public void Should_CRUD_Image_Successfully()
        {
            Events.MediaManage/n ..... /n //View Source file for more details /n }

4. Example

Project: BetterCMS
Source File: PageContentsApiTests.cs
View license
protected override void CheckCreateEvent()
        {
            CheckEventsCount(1, 0, 0);
            
            Assert.AreEqual(contentConfigredCount, setOptions ? 1 : 0, "Content configured events count");
        }

5. Example

Project: BetterCMS
Source File: PageContentsApiTests.cs
View license
protected override void CheckUpdateEvent()
        {
            CheckEventsCount(1, updateOrder ? 1 : 0, 0);

            Assert.AreEqual(contentConfigredCount, setOptions ? 2 : 0, "Content configured events count");
        }

6. Example

Project: BetterCMS
Source File: PagePropertiesApiTests.cs
View license
[Test]
        public void Should_CRUD_PageProperties_WithLayout_Successfully()
        {
          /n ..... /n //View Source file for more details /n }

7. Example

Project: BetterCMS
Source File: PagePropertiesApiTests.cs
View license
[Test]
        public void Should_CRUD_PageProperties_WithMasterPage_Successfully()
        {
      /n ..... /n //View Source file for more details /n }

8. Example

Project: BetterCMS
Source File: NodesTests.cs
View license
[Test]
        public void Should_CRUD_Node_Successfully()
        {
            // Attach to events
            Events.SitemapEvents.Instance.SitemapUpdated += Instance_SitemapUpdated;
            Events.SitemapEvents.Instance.SitemapNodeCreated += Instance_EntityCreated;
            Events.SitemapEvents.Instance.SitemapNodeUpdated += Instance_EntityUpdated;
            Events.SitemapEvents.Instance.SitemapNodeDeleted += Instance_EntityDeleted;

            RunApiActionInTransaction(
                (api, session) =>
                    {
                        var sitemap = this.TestDataProvider.CreateNewSitemap();
                        session.SaveOrUpdate(sitemap);
                        session.Flush();
                        SitemapId = sitemap.Id;

                        Run(session, api.Pages.SitemapNew.Nodes.Post, api.Pages.SitemapNew.Node.Get, api.Pages.SitemapNew.Node.Put, api.Pages.SitemapNew.Node.Delete);
                    });

            Assert.AreEqual(3, updatedSitemapEventCount, "Updated sitemap events fired count");

            // Detach from events
            Events.SitemapEvents.Instance.SitemapNodeCreated -= Instance_EntityCreated;
            Events.SitemapEvents.Instance.SitemapNodeUpdated -= Instance_EntityUpdated;
            Events.SitemapEvents.Instance.SitemapNodeDeleted -= Instance_EntityDeleted;
        }

9. Example

Project: BetterCMS
Source File: SitemapsTests.cs
View license
[Test]
        public void Should_CRUD_Sitemap_Successfully()
        {
            // Attach to events
            Events.SitemapEvents.Instance.SitemapCreated += Instance_EntityCreated;
            Events.SitemapEvents.Instance.SitemapUpdated += Instance_EntityUpdated;
            Events.SitemapEvents.Instance.SitemapDeleted += Instance_EntityDeleted;
            Events.SitemapEvents.Instance.SitemapNodeCreated += Instance_SitemapNodeCreated;
            Events.SitemapEvents.Instance.SitemapNodeDeleted += Instance_SitemapNodeDeleted;

            RunApiActionInTransaction((api, session) => Run(session, api.Pages.Sitemaps.Post, api.Pages.SitemapNew.Get, api.Pages.SitemapNew.Put, api.Pages.SitemapNew.Delete));

            Assert.AreEqual(2, createdNodeEventCount, "Created node events fired count");
            Assert.AreEqual(1, deletedNodeEventCount, "Deleted node events fired count");

            // Detach from events
            Events.SitemapEvents.Instance.SitemapCreated -= Instance_EntityCreated;
            Events.SitemapEvents.Instance.SitemapUpdated -= Instance_EntityUpdated;
            Events.SitemapEvents.Instance.SitemapDeleted -= Instance_EntityDeleted;
            Events.SitemapEvents.Instance.SitemapNodeCreated -= Instance_SitemapNodeCreated;
            Events.SitemapEvents.Instance.SitemapNodeDeleted += Instance_SitemapNodeDeleted;
        }

10. Example

Project: BetterCMS
Source File: NodesApiTests.cs
View license
[Test]
        public void Should_CRUD_Node_Successfully()
        {
            // Attach to events
            Events.RootEvents.Instance.CategoryTreeUpdated += Instance_SitemapUpdated;
            Events.RootEvents.Instance.CategoryCreated += Instance_EntityCreated;
            Events.RootEvents.Instance.CategoryUpdated += Instance_EntityUpdated;
            Events.RootEvents.Instance.CategoryDeleted += Instance_EntityDeleted;

            RunApiActionInTransaction(
                (api, session) =>
                    {
                        var categoryTree = this.TestDataProvider.CreateNewCategoryTree();
                        session.SaveOrUpdate(categoryTree);
                        session.Flush();
                        CategoryTreeId = categoryTree.Id;

                        Run(session, api.Root.Category.Nodes.Post, api.Root.Category.Node.Get, api.Root.Category.Node.Put, api.Root.Category.Node.Delete);
                    });

            Assert.AreEqual(3, updatedCategoryTreeEventCount, "Updated category tree events fired count");

            // Detach from events
            Events.RootEvents.Instance.CategoryCreated -= Instance_EntityCreated;
            Events.RootEvents.Instance.CategoryUpdated -= Instance_EntityUpdated;
            Events.RootEvents.Instance.CategoryDeleted -= Instance_EntityDeleted;
        }

11. Example

Project: BetterCMS
Source File: CategoriesApiTests.cs
View license
[Test]
        public void Should_CRUD_CategoryTree_Successfully()
        {
            // Attach to events
            RootEvents.Instance.CategoryTreeCreated += Instance_EntityCreated;
            RootEvents.Instance.CategoryTreeUpdated += Instance_EntityUpdated;
            RootEvents.Instance.CategoryTreeDeleted += Instance_EntityDeleted;
            RootEvents.Instance.CategoryCreated += Instance_CategoryNodeCreated;
            RootEvents.Instance.CategoryDeleted += Instance_CategoryNodeDeleted;

            RunApiActionInTransaction((api, session) => Run(session, api.Root.Categories.Post, api.Root.Category.Get, api.Root.Category.Put, api.Root.Category.Delete));

            Assert.AreEqual(2, createdNodeEventCount, "Created node events fired count");
            Assert.AreEqual(1, deletedNodeEventCount, "Deleted node events fired count");

            // Detach from events
            RootEvents.Instance.CategoryTreeCreated -= Instance_EntityCreated;
            RootEvents.Instance.CategoryTreeUpdated -= Instance_EntityUpdated;
            RootEvents.Instance.CategoryTreeDeleted -= Instance_EntityDeleted;
            RootEvents.Instance.CategoryCreated -= Instance_CategoryNodeCreated;
            RootEvents.Instance.CategoryDeleted += Instance_CategoryNodeDeleted;
        }

12. Example

View license
protected void CheckEventsCount(int expectedCreatedCount, int expectedUpdatedCount, int expectedDeletedCount)
        {
            Assert.AreEqual(expectedCreatedCount, createdEventCount, "Created events fired count");
            Assert.AreEqual(expectedUpdatedCount, updatedEventCount, "Updated events fired count");
            Assert.AreEqual(expectedDeletedCount, deletedEventCount, "Deleted events fired count");
        }

13. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void AsInt_int_evaluates_to_expected_value()
        {
            const int expected = 10;
            var systemUnderTest = new ValueObject(expected);
            Assert.AreEqual(expected, systemUnderTest.AsInt, "AsInt should return the value of the wrapped integer.");
        }

14. Example

Project: NPOI
Source File: TestEventRecordFactory.cs
View license
private void CompareData(Record record, String message)
            {
                byte[] recData = record.Serialize();
                for (int i = 0; i < recData.Length; i++)
                {
                    Assert.AreEqual(recData[i], data[offset[0]++], message + " data byte " + i);
                }
            }

15. Example

Project: NPOI
Source File: TestDConRefRecord.cs
View license
[Test]
        public void TestGetSid()
        {
            DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data1));
            short expResult = 81;
            short result = instance.Sid;
            Assert.AreEqual(expResult, result, "SID");
        }

16. Example

Project: NPOI
Source File: TestHSSFWorkbook.cs
View license
[Test]
        public void Bug50298()
        {
            HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("50298.xls");

            assertSheetOrder(wb, "Invoice", "Invoice1", "Digest", "Deferred", "Received");

            ISheet sheet = wb.CloneSheet(0);

            assertSheetOrder(wb, "Invoice", "Invoice1", "Digest", "Deferred", "Received", "Invoice (2)");

            wb.SetSheetName(wb.GetSheetIndex(sheet), "copy");

            assertSheetOrder(wb, "Invoice", "Invoice1", "Digest", "Deferred", "Received", "copy");

            wb.SetSheetOrder("copy", 0);

            assertSheetOrder(wb, "copy", "Invoice", "Invoice1", "Digest", "Deferred", "Received");

            wb.RemoveSheetAt(0);

            assertSheetOrder(wb, "Invoice", "Invoice1", "Digest", "Deferred", "Received");


            // check that the overall workbook serializes with its correct size
            int expected = wb.Workbook.Size;
            int written = wb.Workbook.Serialize(0, new byte[expected * 2]);

            Assert.AreEqual(expected, written, "Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected);

            HSSFWorkbook read = HSSFTestDataSamples.WriteOutAndReadBack(wb);
            assertSheetOrder(read, "Invoice", "Invoice1", "Digest", "Deferred", "Received");
        }

17. Example

Project: NPOI
Source File: TestHSSFWorkbook.cs
View license
[Test]
        public void Bug50298a()
        {
            HSSFWorkbook wb = HSSFTestDataSamples.O/n ..... /n //View Source file for more details /n }

18. Example

Project: NPOI
Source File: TestNPOIFSFileSystem.cs
View license
protected static void assertBATCount(NPOIFSFileSystem fs, int expectedBAT, int expectedXBAT)
        {
            int foundBAT = 0;
            int foundXBAT = 0;
            int sz = (int)(fs.Size / fs.GetBigBlockSize());
            for (int i = 0; i < sz; i++)
            {
                if (fs.GetNextBlock(i) == POIFSConstants.FAT_SECTOR_BLOCK)
                {
                    foundBAT++;
                }
                if (fs.GetNextBlock(i) == POIFSConstants.DIFAT_SECTOR_BLOCK)
                {
                    foundXBAT++;
                }
            }
            Assert.AreEqual(expectedBAT, foundBAT, "Wrong number of BATs");
            Assert.AreEqual(expectedXBAT, foundXBAT, "Wrong number of XBATs with " + expectedBAT + " BATs");
        }

19. Example

Project: NPOI
Source File: TestDocumentBlock.cs
View license
[Test]
        public void TestRead()
        {
            DocumentBlock[] blocks = new DocumentBlock[4];
            MemoryStream input = new MemoryStream(_testdata);

            for (int j = 0; j < 4; j++)
            {
                blocks[j] = new DocumentBlock(input, POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS);
            }
            for (int j = 1; j <= 2000; j += 17)
            {
                byte[] buffer = new byte[j];
                int offset = 0;

                for (int k = 0; k < (2000 / j); k++)
                {
                    DocumentBlock.Read(blocks, buffer, offset);
                    for (int n = 0; n < buffer.Length; n++)
                    {
                        Assert.AreEqual(_testdata[(k * j) + n], buffer[n]
                            , "checking byte " + (k * j) + n);
                    }
                    offset += j;
                }
            }
        }

20. Example

Project: NPOI
Source File: TestByteField.cs
View license
[Test]
        public void TestWriteToBytes()
        {
            ByteField field = new ByteField(0);
            byte[]    array = new byte[ 1 ];

            for (int j = 0; j < _test_array.Length; j++)
            {
                field.Value=_test_array[ j ];
                field.WriteToBytes(array);
                Assert.AreEqual(_test_array[j], array[0], "testing ");
            }
        }

21. Example

Project: NPOI
Source File: TestIntegerField.cs
View license
[Test]
        public void TestWriteToBytes()
        {
            IntegerField field = new IntegerField(0);
            byte[]       array = new byte[ 4 ];

            for (int j = 0; j < _test_array.Length; j++)
            {
                field.Value=_test_array[ j ];
                field.WriteToBytes(array);
                int val = array[ 3 ] << 24;

                val &= unchecked((int)0xFF000000);
                val += (array[ 2 ] << 16) & 0x00FF0000;
                val += (array[ 1 ] << 8) & 0x0000FF00;
                val += (array[ 0 ] & 0x000000FF);
                Assert.AreEqual(_test_array[j], val, "testing ");
            }
        }

22. Example

Project: NPOI
Source File: TestShortField.cs
View license
[Test]
        public void TestWriteToBytes()
        {
            ShortField field = new ShortField(0);
            byte[] array = new byte[2];

            for (int j = 0; j < _test_array.Length; j++)
            {
                field.Value = _test_array[j];
                field.WriteToBytes(array);
                short val = (short)(array[1] << 8);

                val &= unchecked((short)0xFF00);
                val += (short)(array[0] & 0x00FF);
                Assert.AreEqual(_test_array[j], val, "testing ");
            }
        }

23. Example

Project: DotSpatial
Source File: FeedManagerTests.cs
View license
[TestMethod]
        public void RemoveFeedThatIsNotInTheListDoesNothing()
        {
            FeedManager.ClearFeeds();

            Feed feed = new Feed
            {
                Name = "sample feed",
                Url = "https://example.com"
            };
            FeedManager.Add(feed);

            var before = FeedManager.GetFeeds();

            FeedManager.Remove(feed);

            var after = FeedManager.GetFeeds();
            Assert.AreEqual(before.Count(), after.Count(), "The number of feeds should be the same if an attempt is made to remove a feed that is not in the list.");
        }

24. Example

View license
[Test]
        public void IndexOfAny_NoMatches_EmptyCollection()
        {

            vCardSubpropertyCollection subs =
                new vCardSubpropertyCollection();

            int index = subs.IndexOfAny(
                new string[] { "FIND1", "FIND2", "FIND3" });

            Assert.AreEqual(
                -1,
                index,
                "No matches should have been found.");

        }

25. Example

View license
[Test]
        public void IndexOfAny_NoMatches_PopulatedCollection()
        {

            vCardSubpropertyCollection subs =
                new vCardSubpropertyCollection();

            subs.Add("NAME1");
            subs.Add("NAME2");
            subs.Add("NAME3");

            int index = subs.IndexOfAny(
                new string[] { "FIND1", "FIND2", "FIND3" });

            Assert.AreEqual(
                -1,
                index,
                "No matches should have been found.");

        }

26. Example

Project: AssertMessage
Source File: NunitTests.cs
View license
public void AreEqual_should_have_message_original_message()
        {
            var expected = 1;
            var actual = 2;

            Assert.AreEqual(expected, actual, "original_message");
        }

27. Example

View license
void Verify(byte[] buffer, int startOffset, int count, byte expected)
        {
            for (int i = startOffset; i < startOffset + count; i++)
                Assert.AreEqual(buffer[i], expected, "#" + i);
        }

28. Example

Project: imt-wanke-client
Source File: PeerTests.cs
View license
[Test]
        public void CorruptDictionary()
        {
            BEncodedList l = new BEncodedList();
            BEncodedDictionary d = new BEncodedDictionary();
            l.Add(d);
            IList<Peer> decoded = Peer.Decode(l);
            Assert.AreEqual(0, decoded.Count, "#1");
        }

29. Example

Project: imt-wanke-client
Source File: PeerTests.cs
View license
[Test]
        public void CorruptString()
        {
            IList<Peer> p = Peer.Decode((BEncodedString)"1234");
            Assert.AreEqual(0, p.Count, "#1");

            byte[] b = new byte[] { 255, 255, 255, 255, 255, 255 };
            p = Peer.Decode((BEncodedString)b);
            Assert.AreEqual(1, p.Count, "#2");

            b = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            p = Peer.Decode((BEncodedString)b);
            Assert.AreEqual(1, p.Count, "#3");
        }

30. Example

Project: 32feet
Source File: LanguageBaseListTests.cs
View license
[Test]
        public void TestAllDefinedCharsetMappingRows()
        {
            int numberSuccessful, numberFailed;
            String resultText = 
                LanguageBaseItem.TestAllDefinedEncodingMappingRows(out numberSuccessful, out numberFailed);
            int successExpected = 16;
            int failedExpected = 3;
#if NETCF
            successExpected = 10;
            failedExpected = 9;
#endif
            Assert.AreEqual(successExpected, numberSuccessful, "numberSuccessful");
            Assert.AreEqual(failedExpected, numberFailed, "numberFailed");
            //-Console.WriteLine(resultText);
        }

31. Example

Project: 32feet
Source File: TestLsnrRfcommPort.cs
View license
public void AssertOpenServerNotCalled()
        {
            Assert.AreEqual(0, m_OpenServerCalled, "NOT OpenServerCalled");
        }

32. Example

Project: 32feet
Source File: TestLsnrRfcommPort.cs
View license
public void AssertOpenServerCalledAndClear(byte channel)
        {
            Assert.AreEqual(1, m_OpenServerCalled, "OpenServerCalled");
            //Assert.AreEqual(address, m_ocAddress, "Address");
            //Assert.AreEqual(channel, m_ocScn, "Channel");
            //
            m_OpenServerCalled = 0;
            //...
        }

33. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertEquals(string message, int expected, int actual) 
		{
			NUnit.Framework.Assert.AreEqual(expected, actual, message);
		}

34. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void AssertEquals(string message, int expected, int actual) 
		{
			NUnit.Framework.Assert.AreEqual(expected, actual, message);
		}

35. Example

Project: dlr
Source File: ScriptSourceTest.cs
View license
[Test]
        public void Execute_MultipleInvocation()
        {
            string singleExp = _codeSnippets[CodeType.SimpleExpressionOnePlusOne];
            int expResult = 2;

            ScriptSource source = _testEng.CreateScriptSourceFromString(singleExp,
                                        SourceCodeKind.Expression);
            int testRuns = 10;
            object result;

            for (int i = 0; i < testRuns; i++)
            {
                result = source.Execute(_testEng.CreateScope());
                Assert.AreEqual(expResult, (int)result, "Test Multiple Calls to Execute");
            }
        }

36. Example

View license
[Test]
        public void CanParseNestedComments()
        {
            const string script = @"/*
select 1
/* nested comment */
go
delete from users
-- */";
            var scripts = new ScriptSplitter(script);
            Assert.AreEqual(1, scripts.Count(), "This contains a comment and no scripts.");
        }

37. Example

View license
[Test]
        public void CanParseSuccessiveGoStatements()
        {
            const string script = @"GO
GO";
            var scripts = new ScriptSplitter(script);
            Assert.AreEqual(0, scripts.Count(), "Expected no scripts since they would be empty.");
        }

38. Example

View license
[Test]
        public void SemiColonDoesNotSplitScript()
        {
            const string script = "CREATE PROC Blah AS SELECT FOO; SELECT Bar;";
            var scripts = new ScriptSplitter(script);
            Assert.AreEqual(1, scripts.Count(), "Expected no scripts since they would be empty.");
        }

39. Example

View license
private static void AssertLineCounters(BufferedCharReader reader, int line, int pos)
        {
            Assert.AreEqual(line, reader.LineNumber, "LineNumber");
            Assert.AreEqual(pos, reader.LinePosition, "LinePosition");
        }

40. Example

Project: linq2db
Source File: SelectTests.cs
View license
[Test, DataContextSource(false)]
		public void MutiplySelect12(string context)
		{
			using (var db = GetDataContext(context))
			{
				var q =
					from grandChild in db.GrandChild
					from child in db.Child
					where grandChild.ChildID.HasValue
					select grandChild;
				q.ToList();

				var selectCount = ((DataConnection)db).LastQuery
					.Split(' ', '\t', '\n', '\r')
					.Count(s => s.Equals("select", StringComparison.OrdinalIgnoreCase));

				Assert.AreEqual(1, selectCount, "Why do we need \"select from select\"??");
			}
		}

41. Example

Project: DReAM
Source File: Split.cs
View license
[Test]
        public void Split_can_handle_one_element() {

            // Arrange
            var array = new[] { 1 };

            // Act
            var chunks = array.Split(100);

            // Assert
            Assert.AreEqual(1, chunks.Count(), "There should only be one chunk");
            Assert.AreEqual(1, chunks.First().Count(), "Chunk should only contain one element");
        }

42. Example

View license
[Test]
		public void ForEachTest()
		{
			var _dictionary = new MessagePackObjectDictionary();
			_dictionary.Add( "key1", "value1" );
			_dictionary.Add( "key2", "value2" );
			_dictionary.Add( "key3", "value3" );
			_dictionary.Add( "key4", "value4" );

			int i = 0;
			foreach ( KeyValuePair<MessagePackObject, MessagePackObject> entry in _dictionary )
				i++;
			Assert.AreEqual( 4, i, "fail1: foreach entry failed!" );

			i = 0;
			foreach ( KeyValuePair<MessagePackObject, MessagePackObject> entry in ( ( IEnumerable )_dictionary ) )
				i++;
			Assert.AreEqual( 4, i, "fail2: foreach entry failed!" );

			i = 0;
			foreach ( DictionaryEntry entry in ( ( IDictionary )_dictionary ) )
				i++;
			Assert.AreEqual( 4, i, "fail3: foreach entry failed!" );
		}

43. Example

Project: n2cms
Source File: EnumerableAssert.cs
View license
public static void Count(int count, IEnumerable list)
        {
            int i = 0;
            foreach (object o in list)
                ++i;
            Assert.AreEqual(count, i, "Expected list count " + count + " but was " + i);
        }

44. Example

View license
protected void AssertNoPersons()
		{
			using (var s = OpenSession())
			using (var t = s.BeginTransaction())
			{
				Assert.AreEqual(0, s.Query<Person>().Count(), "Entities found in database.");
				t.Commit();
			}
		}

45. Example

Project: nhibernate-core
Source File: ObjectAssertion.cs
View license
public static void AreEqual(DateTime expected, DateTime actual, bool useMilliseconds)
		{
			Assert.AreEqual(expected.Year, actual.Year, "Year");
			Assert.AreEqual(expected.Month, actual.Month, "Month");
			Assert.AreEqual(expected.Day, actual.Day, "Day");
			Assert.AreEqual(expected.Hour, actual.Hour, "Hour");
			Assert.AreEqual(expected.Minute, actual.Minute, "Minute");
			Assert.AreEqual(expected.Second, actual.Second, "Second");
			if (useMilliseconds)
				Assert.AreEqual(expected.Millisecond, actual.Millisecond, "Millisecond");
		}

46. Example

View license
[Test]
        public void use_sheetData_where_null()
        {
            var factory = new ExcelQueryFactory(_excelFileName + "x", new LogManagerFactory());
            var companies = from c in factory.NamedRange<Company>("NullCellCompanies")
                            where c.EmployeeCount == null
                            select c;

            Assert.AreEqual(2, companies.Count(), "Count");
        }

47. Example

View license
[Test]
        public void use_row_where_null()
        {
            var factory = new ExcelQueryFactory(_excelFileName + "x", new LogManagerFactory());
            var companies = from c in factory.NamedRange("NullCellCompanies")
                            where c["EmployeeCount"] == null
                            select c;

            Assert.AreEqual(2, companies.Count(), "Count");
        }

48. Example

View license
[Test]
        public void use_row_no_header_where_null()
        {
            var factory = new ExcelQueryFactory(_excelFileName + "x", new LogManagerFactory());
            var companies = from c in factory.NamedRangeNoHeader("NullCellCompanies")
                            where c[2] == null
                            select c;

            Assert.AreEqual(2, companies.Count(), "Count");
        }

49. Example

View license
[Test]
        public void use_sheetData_where_null()
        {
            var factory = new ExcelQueryFactory(_excelFileName + "x", new LogManagerFactory());
            var companies = from c in factory.WorksheetRange<Company>("A1", "D4", "NullCells")
                            where c.EmployeeCount == null
                            select c;

            Assert.AreEqual(2, companies.Count(), "Count");
        }

50. Example

View license
[Test]
        public void use_row_where_null()
        {
            var factory = new ExcelQueryFactory(_excelFileName + "x", new LogManagerFactory());
            var companies = from c in factory.WorksheetRange("A1", "D4", "NullCells")
                            where c["EmployeeCount"] == null
                            select c;

            Assert.AreEqual(2, companies.Count(), "Count");
        }