NUnit.Framework.Assert.Null(object)

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

200 Examples 7

1. Example

Project: concordion-net
Source File: Resource_Fixture.cs
View license
[Test]
        public void Test_If_Parent_Of_Root_Is_Null()
        {
            Assert.Null(new Resource(@"\").Parent);
        }

2. Example

Project: OrigoDB
Source File: KeyTests.cs
View license
[Test]
        public void Random_Key_Null_when_no_keys_exists()
        {
            var actual = _target.RandomKey();
            Assert.Null(actual);
        }

3. Example

Project: FastString
Source File: CharInfoSmokeTest.cs
View license
[Test]
		public void NotFound()
		{
			Assert.Null(CharInfo.For(0x30000));
		}

4. Example

View license
[Test]
        public void TestAlternateFormatsFailsGracefully()
        {
            var noAlternateFormats = MetadataManager.GetAlternateFormatsForCountry(999);
            Assert.Null(noAlternateFormats);
        }

5. Example

Project: TabulaRasa
Source File: DocxDocumentTests.cs
View license
[Test]
        public void GetCustomPropertyFromDocumentReturnNullIfItDoesNotExists()
        {
            using (var docxDocument = new DocxDocument(Resources.DocumentWithoutAttributes))
            {
                Assert.Null(docxDocument.GetCustomProperty("customAttributes"));
            }
        }

6. Example

View license
[Test]
        public void Indexer_String_Get_If_NotExists_ReturnNull()
        {
            var row = _rows["row_with_name_that_does_not_exists"];

            Assert.Null(row);
        }

7. Example

Project: CoCSharp
Source File: CsvDataRowTests.cs
View license
[Test]
        public void Indexer_Getter_Column_Belongs_ToTable_ReturnsValue()
        {
            var column = new CsvDataColumn();
            _table.Columns.Add(column);

            Assert.Null(_row[column]);
        }

8. Example

View license
[Test]
        public void Pop_PoolEmpty_RetusnNull()
        {
            var pool = new SocketAsyncEventArgsPool(1);
            var args = pool.Pop();
            Assert.Null(args);
        }

9. Example

Project: SeleniumBasic
Source File: TS_SearchContext.cs
View license
[TestCase]
        public void ShouldFindWithNoException() {
            var ele = driver.FindElementById("id-missing", 0, false);
            A.Null(ele);
        }

10. Example

View license
[Test]
    [Category("Small")]
    public void TestCleanupAfterCall() {
      listener = new MockTraceListener(config);
      ContextStore.AddKey("SoapRequest", "SoapRequest");
      ContextStore.AddKey("SoapResponse", "SoapResponse");
      ContextStore.AddKey("FormattedSoapLog", "FormattedSoapLog");
      ContextStore.AddKey("FormattedRequestLog", "FormattedRequestLog");
      listener.CleanupAfterCall();
      Assert.Null(ContextStore.GetValue("SoapRequest"));
      Assert.Null(ContextStore.GetValue("SoapResponse"));
      Assert.Null(ContextStore.GetValue("FormattedSoapLog"));
      Assert.Null(ContextStore.GetValue("FormattedRequestLog"));
    }

11. Example

Project: tdd-toolkit
Source File: AnySpecification.cs
View license
[Test]
    public void ShouldHandleCopyConstructorsSomehow()
    {
      var o = Any.Instance<ObjectWithCopyConstructor>();
      Assert.Null(o._field);
    }

12. Example

Project: mini-web-deploy
Source File: AndSiteExists.cs
View license
[Test]
        public void ExistingSiteIsDeleted()
        {
            Assert.Null(new ServerManager().Sites.SingleOrDefault(x => x.Name == SiteName));
        }

13. Example

View license
[Test]
        public void ExistingSiteDoeNotExist_AndExceptionIsNotThrown()
        {
            Assert.Null(new ServerManager().Sites.SingleOrDefault(x => x.Name == SiteName));
        }

14. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose()
        {
            // Arrange
            DatabaseCommand databaseCommand = Sequelocity.GetDatabaseCommandForSQLite( ConnectionStringsNames.SqliteInMemoryDatabaseConnectionString );

            // Act
            databaseCommand.Dispose();

            // Assert
            Assert.Null( databaseCommand.DbCommand );
        }

15. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose_In_A_Using_Statement()
        {
            // Arrange
            DatabaseCommand databaseCommand;

            // Act
            using( databaseCommand = Sequelocity.GetDatabaseCommandForSQLite( ConnectionStringsNames.SqliteInMemoryDatabaseConnectionString ) )
            {

            }

            // Assert
            Assert.Null( databaseCommand.DbCommand );
        }

16. Example

View license
[Test]
        public void Accessing_A_Not_Existent_Property_Should_Return_Null()
        {
            dynamic obj = new DynamicDictionary();

            var firstName = obj.FirstName;

            Assert.Null( firstName );
        }

17. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose_In_A_Using_Statement()
        {
            // Arrange
            DatabaseCommand databaseCommand;

            // Act
            using( databaseCommand = Sequelocity.GetDatabaseCommand( ConnectionStringsNames.MySqlConnectionString ) )
            {

            }

            // Assert
            Assert.Null( databaseCommand.DbCommand );
        }

18. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose()
        {
            // Arrange
            DatabaseCommand databaseCommand = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString);

            // Act
            databaseCommand.Dispose();

            // Assert
            Assert.Null(databaseCommand.DbCommand);
        }

19. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose_In_A_Using_Statement()
        {
            // Arrange
            DatabaseCommand databaseCommand;

            // Act
            using (databaseCommand = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString))
            {

            }

            // Assert
            Assert.Null(databaseCommand.DbCommand);
        }

20. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose()
        {
            // Arrange
            DatabaseCommand databaseCommand = Sequelocity.GetDatabaseCommand( ConnectionStringsNames.MySqlConnectionString );

            // Act
            databaseCommand.Dispose();

            // Assert
            Assert.Null( databaseCommand.DbCommand );
        }

21. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose_In_A_Using_Statement()
        {
            // Arrange
            DatabaseCommand databaseCommand;

            // Act
            using( databaseCommand = Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString ) )
            {

            }

            // Assert
            Assert.Null( databaseCommand.DbCommand );
        }

22. Example

View license
[Test]
        public void Should_Null_The_DbCommand_On_Dispose()
        {
            // Arrange
            DatabaseCommand databaseCommand = Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString );

            // Act
            databaseCommand.Dispose();

            // Assert
            Assert.Null( databaseCommand.DbCommand );
        }

23. Example

Project: NRack
Source File: HeaderHash_Specs.cs
View license
[Test]
        public void Should_Return_Null_When_Delete_Is_Called_On_A_Non_Existent_Key()
        {
            var headers = new HeaderHash(new Hash { { "foo", "bar" } });

            Assert.Null(headers.Delete("Hello"));            
        }

24. Example

Project: Frontenac
Source File: VertexTestSuite.cs
View license
[Test]
        public void TestGetNonExistantVertices()
        {
            var graph = GraphTest.GenerateGraph();
            try
            {
                Assert.Null(graph.GetVertex("asbv"));
                Assert.Null(graph.GetVertex(12.0d));
            }
            finally
            {
                graph.Shutdown();
            }
        }

25. Example

View license
[Test]
        public void TestNonExistentIndices()
        {
            var graph = (IIndexableGraph) GraphTest.GenerateGraph();
            try
            {
                if (!graph.Features.SupportsVertexIndex || !graph.Features.SupportsEdgeIndex ||
                    !graph.Features.SupportsIndices) return;

                StopWatch();
                Assert.Null(graph.GetIndex("bloop", typeof (IVertex)));
                Assert.Null(graph.GetIndex("bam", typeof (IEdge)));
                Assert.Null(graph.GetIndex("blah blah", typeof (IEdge)));
                PrintPerformance(graph.ToString(), 3, "non-existent indices retrieved", StopWatch());
            }
            finally
            {
                graph.Shutdown();
            }
        }

26. Example

Project: scriban
Source File: TestFunctions.cs
View license
[Test]
            public void TestOffset()
            {
                Assert.Null(ArrayFunctions.Offset(null, 0));
            }

27. Example

Project: scriban
Source File: TestFunctions.cs
View license
[Test]
            public void TestLimit()
            {
                Assert.Null(ArrayFunctions.Limit(null, 0));
            }

28. Example

Project: PieDb
Source File: SessionTests.cs
View license
[Test]
        public void WillNotPhantomTryRead()
        {
            var session = pieDatabase.OpenSession();
            var task = session.Get<Task>("notask");

            {
                var otherSession = pieDatabase.OpenSession();
                otherSession.Store(new Task(), "notask");
                otherSession.Commit();
            }

            task = session.Get<Task>("notask");
            Assert.Null(task);
        }

29. Example

View license
[Test]
        public void CanGetDisallowedProperty()
        {
            var pansy = Hardener.Harden(new Pansy());
            Assert.Null(pansy.Fears);
        }

30. Example

Project: GraphEngine
Source File: StructTest.cs
View license
[Test]
        public void ReqStruct_ShouldHaveDefinedFields()
        {
            var req = new Req();
            req.FieldBeforeList = 1984;
            req.FieldAfterList = 42;
            Assert.Null(req.Nums);
            req.Nums = Enumerable.Concat(Enumerable.Repeat(2, 1), Enumerable.Repeat(3, 10)).ToList();
        }

31. Example

View license
[Test]
        public void ItClearsTheNemesisIdIfThePlayerHasNoNemesis()
        {
            using (NemeStatsDataContext nemeStatsDataContext = new NemeStatsDataContext())
            {
                Player player5 = nemeStatsDataContext.FindById<Player>(testPlayer5.Id);

                Assert.Null(player5.NemesisId);
            }
        }

32. Example

Project: set-locale
Source File: AppServiceTests.cs
View license
[Test]
        public async void create_should_return_null_if_model_is_invalid()
        {
            //arrange
            var invalidModel = new AppModel { Name = "invalidApp" };

            //act
            var sut = new AppServiceBuilder().Build();
            var task = await sut.Create(invalidModel);

            //assert
            Assert.Null(task);
        }

33. Example

Project: nunit3-vs-adapter
Source File: TestTFSBuild.cs
View license
[Test]
        public void PropertyValueProviderCategoryFail()
        {
            var tc = new TestCase("Test1", new Uri("executor://NUnitTestExecutor"), "NUnit.VSIX");
            tc.AddTrait("Category", "CI");
            var testFilter = new TfsTestFilter(null);
            var obj = TfsTestFilter.PropertyValueProvider(tc, "Garbage");
            Assert.Null(obj);
        }

34. Example

Project: nunit3-vs-adapter
Source File: TestTFSBuild.cs
View license
[Test]
        public void TraitProviderWithNoCategory()
        {
            var testFilter = new TfsTestFilter(null);
            var trait = TfsTestFilter.TraitProvider("JustKidding");
            Assert.Null(trait);
        }

35. Example

Project: nunitlite
Source File: TheoryTests.cs
View license
[Theory]
        public void NullDatapointIsOK(object o)
        {
            Assert.Null(o);
            Assert.Null(nullObj); // to avoid a warning
        }

36. Example

Project: nunit-vs-adapter
Source File: TestTFSBuild.cs
View license
[Test]
        public void TraitProviderWithNoCategory()
        {
            var testFilter = new TfsTestFilter(null);
            var trait = TfsTestFilter.TraitProvider("JustKidding");
            Assert.Null(trait);
        }

37. Example

Project: nunit-vs-adapter
Source File: TestTFSBuild.cs
View license
[Test]
        public void PropertyValueProviderCategoryFail()
        {
            var tc = new TestCase("Test1", new Uri("executor://NUnitTestExecutor"), "NUnit.VSIX");
            tc.AddTrait("Category", "CI");
            var testFilter = new TfsTestFilter(null);
            var obj = TfsTestFilter.PropertyValueProvider(tc, "Garbage");
            Assert.Null(obj);
        }

38. Example

View license
[Test]
        public void CannotMakeTestResultWhenTestCaseIsNotInCache()
        {
            var nunitResult = new NUnitTestResult(fakeNUnitTest);
            var testResult = testConverter.ConvertTestResult(nunitResult);
            Assert.Null(testResult);
        }

39. Example

Project: nunit
Source File: TheoryTests.cs
View license
[Theory]
        public void NullDatapointIsOK(object o)
        {
            Assert.Null(o);
            Assert.Null(nullObj); // to avoid a warning
        }

40. Example

Project: nunit
Source File: TestParametersTests.cs
View license
[Test]
        public void Initially_ValuesAreNull()
        {
            Assert.Null(_parameters["ABC"]);
        }

41. Example

Project: nunit
Source File: AssertionResultTests.cs
View license
[Test]
        public void SuiteResultXml_AssertionResults()
        {
            TNode suiteNode = _suiteResult.ToXml(true);
            Assert.Null(suiteNode.SelectSingleNode("assertions"));
        }

42. Example

Project: nunit-console
Source File: TestPackageTests.cs
View license
[Test]
        public void PackageIsAnonymous()
        {
            Assert.Null(package.FullName);
        }

43. Example

Project: nunit-console
Source File: TestPackageTests.cs
View license
[Test]
        public void PackageIsAnonymous()
        {
            Assert.Null(package.FullName);
        }

44. Example

Project: mastodon-api-cs
Source File: LinkTest.cs
View license
[Test]
        public void CreateLinkTestWithEmptyString()
        {
            var str = "";
            var link = Link.CreateLinkFromHeaderLinkValue(str);
            Assert.Null(link);
        }

45. Example

Project: sepawriter
Source File: StringUtilsTest.cs
View license
[Test]
        public void ShouldNotTruncateNullString()
        {
            Assert.Null(StringUtils.GetLimitedString(null, 10));
        }

46. Example

Project: Potato
Source File: TestSandboxedProtocol.cs
View license
[Test]
        public void TestSendSandboxedNull() {
            var controller = new SandboxProtocolController();

            Assert.Null(controller.Send(null));
        }

47. Example

Project: Potato
Source File: TestSandboxedProtocol.cs
View license
[Test]
        public void TestSetupSandboxedNull() {
            var controller = new SandboxProtocolController();

            Assert.Null(controller.Setup(null));
        }

48. Example

Project: Potato
Source File: TestSandboxedProtocol.cs
View license
[Test]
        public void TestStateSandboxedNull() {
            var controller = new SandboxProtocolController();

            Assert.Null(controller.State);
        }

49. Example

Project: Potato
Source File: TestSandboxedProtocol.cs
View license
[Test]
        public void TestOptionsSandboxedNull() {
            var controller = new SandboxProtocolController();

            Assert.Null(controller.Options);
        }

50. Example

Project: Potato
Source File: TestSandboxedProtocol.cs
View license
[Test]
        public void TestActionSandboxedNull() {
            var controller = new SandboxProtocolController();

            Assert.Null(controller.Action(null));
        }