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

101. Example

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

102. 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"));
            }
        }

103. 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);
        }

104. 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]);
        }

105. Example

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

106. 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);
        }

107. 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"));
    }

108. Example

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

109. 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));
        }

110. Example

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

111. 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 );
        }

112. 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 );
        }

113. 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 );
        }

114. 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 );
        }

115. 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);
        }

116. 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);
        }

117. 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 );
        }

118. 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 );
        }

119. 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 );
        }

120. 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"));            
        }

121. 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();
            }
        }

122. 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();
            }
        }

123. Example

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

124. Example

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

125. 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);
        }

126. Example

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

127. 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();
        }

128. Example

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

                Assert.Null(player5.NemesisId);
            }
        }

129. 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);
        }

130. 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);
        }

131. 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);
        }

132. 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
        }

133. 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);
        }

134. 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);
        }

135. Example

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

136. 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
        }

137. Example

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

138. Example

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

139. Example

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

140. Example

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

141. 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);
        }

142. Example

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

143. Example

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

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

144. Example

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

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

145. Example

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

            Assert.Null(controller.State);
        }

146. Example

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

            Assert.Null(controller.Options);
        }

147. Example

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

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

148. Example

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

            Assert.Null(controller.Client);
        }

149. Example

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

            Assert.Null(controller.ProtocolType);
        }

150. Example

Project: pMixins
Source File: MixinMasksTest.cs
View license
[Test]
        public void RepositoryDoesNotImplementIUpdate()
        {
            Assert.Null(_repository as IUpdate<MyEntity>);
        }