NUnit.Framework.Assert.IsNotNull(object)

Here are the examples of the csharp api class NUnit.Framework.Assert.IsNotNull(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: KendoGridBinderEx
Source File: TestHelper.cs
View license
protected static KendoGridBaseRequest SetupBinder(NameValueCollection form, NameValueCollection queryString)
        {
            var fakeRequest = new FakeRequest("POST", form, queryString ?? new NameValueCollection());
            var httpContext = new FakeContext(fakeRequest);

            var controller = new FakeController();
            var controllerContext = new ControllerContext(new RequestContext(httpContext, new RouteData()), controller);
            var modelBindingContext = new ModelBindingContext();

            var binder = new KendoGridMvcModelBinder();
            var model = binder.BindModel(controllerContext, modelBindingContext);
            Assert.IsNotNull(model);

            var gridRequest = model as KendoGridMvcRequest;
            Assert.IsNotNull(gridRequest);

            return gridRequest;
        }

2. Example

View license
private void Parse(string input)
        {
            var context = new ScannerSyntax();
            Language.Parse(context, input);
            Assert.IsNotNull(context.Result.Node);
        }

3. Example

Project: IronTextLibrary
Source File: ResolveTests.cs
View license
[Test]
		public void ResolveNullVersionAssembly ()
		{
			var reference = AssemblyNameReference.Parse ("System.Core");
			reference.Version = null;

			var resolver = new DefaultAssemblyResolver ();
			Assert.IsNotNull (resolver.Resolve (reference));
		}

4. Example

Project: IronTextLibrary
Source File: MethodBodyTests.cs
View license
[TestModule ("iterator.exe")]
		public void Iterator (ModuleDefinition module)
		{
			var method = module.GetType ("Program").GetMethod ("GetLittleArgs");
			Assert.IsNotNull (method.Body);
		}

5. Example

Project: IronTextLibrary
Source File: ResolveTests.cs
View license
static MethodDefinition GetMethodFromDelegate (Delegate @delegate)
		{
			var method = @delegate.Method;
			var type = (TypeDefinition) TypeParser.ParseType (GetCurrentModule (), method.DeclaringType.FullName);

			Assert.IsNotNull (type);

			return type.Methods.Where (m => m.Name == method.Name).First ();
		}

6. Example

Project: Unit-Testing
Source File: Constructor_Should.cs
View license
[Test]
        public void InitilizeLecturesCollection_WhenTheObjectIsConstructed()
        {
            // Arrange & Act
            var course = new Course("Valid name", 5, new DateTime(2017, 02, 10), new DateTime(2017, 03, 10));

            // Assert
            //Assert.IsInstanceOf(typeof(List<ILecture>), course.Lectures);
            //Assert.AreEqual(0, course.Lectures.Count);
            Assert.IsNotNull(course.Lectures);

        }

7. Example

Project: Testura.Code
Source File: StatementTests.cs
View license
[Test]
        public void Iteration_WhenGettingIteration_ShouldNotBeNull()
        {
            Assert.IsNotNull(Statement.Iteration);
        }

8. Example

Project: Testura.Code
Source File: StatementTests.cs
View license
[Test]
        public void Declaration_WhenGettingDeclaration_ShouldNotBeNull()
        {
            Assert.IsNotNull(Statement.Declaration);
        }

9. Example

Project: Testura.Code
Source File: StatementTests.cs
View license
[Test]
        public void Expression_WhenGettingExpression_ShouldNotBeNull()
        {
            Assert.IsNotNull(Statement.Expression);
        }

10. Example

Project: Testura.Code
Source File: StatementTests.cs
View license
[Test]
        public void Selection_WhenGettingSelection_ShouldNotBeNull()
        {
            Assert.IsNotNull(Statement.Selection);
        }

11. Example

Project: Testura.Code
Source File: StatementTests.cs
View license
[Test]
        public void Jump_WhenGettingJump_ShouldNotBeNull()
        {
            Assert.IsNotNull(Statement.Jump);
        }

12. Example

Project: rant
Source File: Queries.cs
View license
[Test]
		public void Basic()
		{
			Assert.IsNotNull(rant.Do("<noun>"));
		}

13. Example

Project: rant
Source File: Variables.cs
View license
[Test]
		public void VariableExists()
		{
			var rant = new RantEngine();
			rant.Do("[vn:testvar;123]");
			Assert.IsNotNull(rant["testvar"]);
		}

14. Example

Project: UnityAutoMoq
Source File: CoreTdd.cs
View license
public static T ShouldNotBeNull<T>(this T @object)
        {
            Assert.IsNotNull(@object);
            return @object;
        }

15. Example

Project: riak-dotnet-client
Source File: QuorumTests.cs
View license
[Test]
        public void Zero_IsValidQuorum()
        {
            var q = new Quorum(0);
            Assert.IsNotNull(q);
        }

16. Example

View license
[Scenario]
        public void Given()
        {
            _interval = new Interval(null);
            _policy = _interval as Rainbow.ObjectFlow.Policies.Policy;
            Assert.IsNotNull(_policy);
        }

17. Example

Project: objectflow
Source File: AssertionExtensions.cs
View license
public static void ShouldNotbeNull(this object obj)
    {
        Assert.IsNotNull(obj);
    }

18. Example

View license
public LocalizedStringResult ShouldNotBeNull()
        {
            Assert.IsNotNull(str);
            return this;
        }

19. Example

Project: ultraviolet
Source File: SyntaxNodeResult.cs
View license
public SyntaxNodeResult<TNode> ShouldNotBeNull()
        {
            Assert.IsNotNull(node);
            return this;
        }

20. Example

Project: ultraviolet
Source File: StringResult.cs
View license
public StringResult ShouldNotBeNull()
        {
            Assert.IsNotNull(str);
            return this;
        }

21. Example

Project: ultraviolet
Source File: CollectionResult.cs
View license
public CollectionResult<T> ShouldNotBeNull()
        {
            Assert.IsNotNull(collection);
            return this;
        }

22. Example

View license
public LocalizedStringVariantResult ShouldNotBeNull()
        {
            Assert.IsNotNull(variant);
            return this;
        }

23. Example

Project: ultraviolet
Source File: ObjectResult.cs
View license
public ObjectResult<T> ShouldNotBeNull()
        {
            Assert.IsNotNull(obj);
            return this;
        }

24. Example

View license
[Test]
        [STAThread]
        public void UpdateCoverageDataForResourceWithNewDateDataTest()
  /n ..... /n //View Source file for more details /n }

25. Example

Project: VSSonarQubeExtension
Source File: PackageTest.cs
View license
[Test]
        public void IsIVsPackage()
        {
            var package = new VsSonarExtensionPackage();
            Assert.IsNotNull(package, "The object does not implement IVsPackage");
        }

26. Example

Project: WowPacketParser
Source File: RowListTest.cs
View license
[Test]
        public void TestEnumerator()
        {
            Assert.IsNotNull(_condList.GetEnumerator());

            foreach (Row<TestDataModel> c in _condList)
                Assert.IsNotNull(c);
        }

27. Example

Project: WowPacketParser
Source File: BiDictionaryTest.cs
View license
[Test]
        public void TestEnumerator()
        {
            Assert.IsNotNull(_biDictionary.GetEnumerator());

            foreach (KeyValuePair<int, double> keyValuePair in _biDictionary)
                Assert.IsNotNull(keyValuePair);
        }

28. Example

Project: arma3beclient
Source File: PlayerUpaterTest.cs
View license
[Test]
        public void Parse1()
        {
            var p =
                Player.Parse(
                    "17  188.162.228.192:63255 172  d074b6194fa864e50956a8294077f24a(OK) Cpt. JET");
            Assert.IsNotNull(p);
        }

29. Example

Project: Umbraco-CMS
Source File: MemberServiceTests.cs
View license
[Test]
        public void ContentXml_Created_When_Saved()
        {
            IMemberType memberType = MockedContentTypes.CreateSimpleMemberType();
            ServiceContext.MemberTypeService.Save(memberType);
            IMember member = MockedMember.CreateSimpleMember(memberType, "test", "[email protected]", "pass", "test");
            ServiceContext.MemberService.Save(member);

            var xml = DatabaseContext.Database.FirstOrDefault<ContentXmlDto>("WHERE nodeId = @Id", new { Id = member.Id });
            Assert.IsNotNull(xml);
        }

30. Example

View license
internal IPublishedContent GetNode(int id)
		{
			var ctx = GetUmbracoContext("/test", 1234);
			var doc = ctx.ContentCache.GetById(id);
			Assert.IsNotNull(doc);
			return doc;
		}

31. Example

View license
internal DynamicPublishedContent GetNode(int id)
		{
			//var template = Template.MakeNew("test", new User(0));
			//var ctx = GetUmbracoContext("/test", template.Id);
			var ctx = GetUmbracoContext("/test", 1234);
			var doc = ctx.ContentCache.GetById(id);
			Assert.IsNotNull(doc);
			var dynamicNode = new DynamicPublishedContent(doc);
			Assert.IsNotNull(dynamicNode);
			return dynamicNode;
		}

32. Example

Project: Umbraco-CMS
Source File: TaskRepositoryTest.cs
View license
[Test]
        public void Get_By_Id()
        {
            var provider = new PetaPocoUnitOfWorkProvider(Logger);
            var unitOfWork = provider.GetUnitOfWork();
            using (var repo = new TaskRepository(unitOfWork, CacheHelper, Logger, SqlSyntax))
            {
                var task = new Task(new TaskType("asdfasdf"))
                {
                    AssigneeUserId = 0,
                    Closed = false,
                    Comment = "hello world",
                    EntityId = -1,
                    OwnerUserId = 0
                };

                repo.AddOrUpdate(task);
                unitOfWork.Commit();

                //re-get 
                task = repo.Get(task.Id);

                Assert.IsNotNull(task);
            }
        }

33. Example

View license
[Test]
        public void Can_Create_Container()
        {
            // Arrange
            var cts = ServiceContext.ContentTypeService;

            // Act
            var container = new EntityContainer(Constants.ObjectTypes.DocumentTypeGuid);
            container.Name = "container1";
            cts.SaveContentTypeContainer(container);

            // Assert
            var createdContainer = cts.GetContentTypeContainer(container.Id);
            Assert.IsNotNull(createdContainer);
        }

34. Example

Project: Umbraco-CMS
Source File: DynamicNodeTests.cs
View license
protected override dynamic GetDynamicNode(int id)
        {
            //var template = Template.MakeNew("test", new User(0));
            //var ctx = GetUmbracoContext("/test", template.Id);
            var ctx = GetUmbracoContext("/test", 1234);

            var cache = ctx.ContentCache.InnerCache as PublishedContentCache;
            if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported.");

            var node = new DynamicNode(
                new DynamicBackingItem(
                    new Node(cache.GetXml(ctx, ctx.InPreviewMode).SelectSingleNode("//*[@id='" + id + "' and @isDoc]"))));
            Assert.IsNotNull(node);
            return (dynamic)node;
        }

35. Example

View license
[Test]
		public void Get_Engine()
		{
			var engine1 = MacroEngineFactory.GetEngine("MacroEngine1");
			Assert.IsNotNull(engine1);
		}

36. Example

Project: SimpleAnimation
Source File: StateAccessTests.cs
View license
[Test]
        public void State_Name_RenamedState_CanBeFound_ByNewName([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type)
        {
            IAnimation animation = ComparativeTestFixture.Instantiate(type);
            var clip = Resources.Load<AnimationClip>("LinearX");
            var clipInstance = Object.Instantiate<AnimationClip>(clip);
            clipInstance.legacy = animation.usesLegacy;

            animation.AddClip(clipInstance, "ValidName");
            IAnimationState state = animation.GetState("ValidName");
            state.name = "NewName";
            state = animation.GetState("NewName");
            Assert.IsNotNull(state);
        }

37. Example

Project: SimpleAnimation
Source File: StateAccessTests.cs
View license
[Test]
        public void State_Name_EmptyString_CanBeFound([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type)
        {
            IAnimation animation = ComparativeTestFixture.Instantiate(type);
            var clip = Resources.Load<AnimationClip>("LinearX");
            var clipInstance = Object.Instantiate<AnimationClip>(clip);
            clipInstance.legacy = animation.usesLegacy;

            animation.AddClip(clipInstance, "ValidName");
            IAnimationState state = animation.GetState("ValidName");
            state.name = "";
            state = animation.GetState("");
            Assert.IsNotNull(state);
        }

38. Example

View license
[Test]
		public void GetsServerAddressFromUriFile()
		{
			const string serverExecutable = "server.exe";
			const string uriFilePath = "server.uri";
			const string serverAddress = "http://localhost:1337/";

			// provider tries to delete pid file to decide if it needs
			// to start the server
			var fileSystem = MockFor<IFileSystem>();
			var uriFile = MockFor<IFile>();
			fileSystem
				.Setup(_ => _.FileFor(uriFilePath))
				.Returns(uriFile.Object);

			// throw IOException when provider tries to delete the file
			// to signal server is already running
			uriFile
				.Setup(_ => _.Delete())
				.Throws(new IOException());

			uriFile
				.Setup(_ => _.ReadAllText())
				.Returns(serverAddress);
			
			var subject = new ObservableServiceClientProvider
			{
				FileSystem = fileSystem.Object,
				Logger = new StandardLogger()
			};
			Assert.IsNotNull(subject.ClientFor(serverExecutable).FirstOrTimeout(TimeSpan.FromSeconds(1)));

			VerifyAllMocks();
		}

39. Example

View license
[Test]
		public void ContentTypeWithoutClassifierIsSupported()
		{
			var contentType = MockFor<IContentType>();
			contentType
				.Setup(c => c.GetService(typeof(IClassifierProvider)))
				.Returns(null);

			var textDocument = MockFor<ITextDocument>();
			textDocument
				.SetupGet(d => d.Buffer)
				.Returns(new TextBuffer("", contentType.Object));

			var file = MockFor<IFile>();
			var textDocumentFactory = MockFor<ITextDocumentFactory>();
			textDocumentFactory
			.Setup(f => f.ForFile(file.Object))
			.Returns(textDocument.Object);

			var factory = new TextViewDocumentFactory
			{
				TextDocumentFactory = textDocumentFactory.Object,
				ClassificationStyler = MockFor<IClassificationStyler>().Object,
				CaretFactory = MockFor<ICaretFactory>(MockBehavior.Loose).Object
			};

			var textViewDocument = factory.DocumentForFile(file.Object);
			Assert.IsNotNull(textViewDocument);

			VerifyAllMocks();
		}

40. Example

Project: Balder
Source File: GraphWithPropertiesTests.cs
View license
[Test]
        public void GraphInitializerConstructorTest()
        {

            var graph = EmptyGraphFactory.CreateGraph(g => g.Set("hello", "world!"));

            Assert.IsNotNull(graph);
            Assert.IsNotNull(graph.IdKey);
            Assert.IsNotNull(graph.RevIdKey);

        }

41. Example

Project: Balder
Source File: GraphWithPropertiesTests.cs
View license
[Test]
        public void EmptyConstructorTest()
        {
            Assert.IsNotNull(EmptyGraphFactory.CreateGraph());
        }

42. Example

Project: Simple.Data.Mysql
Source File: FindTests.cs
View license
[Test]
        public void TestImplicitEnumerableCast()
        {
            var db = Database.Opener.OpenConnection(ConnectionString);
            foreach (User user in db.Users.All())
            {
                Assert.IsNotNull(user);
            }
        }

43. Example

View license
[Test]
		public void TestConstructor()
		{
			Assert.IsNotNull(_server);
		}

44. Example

Project: codegenerator
Source File: TestParser.cs
View license
[Test]
		public void TestConstructor()
		{
			Assert.IsNotNull(_parser);
		}

45. Example

View license
[Test]
		public void TestConstructor()
		{
			manager = new DataTypeManager();
			Assert.IsNotNull(manager);
		}

46. Example

Project: MollieApi
Source File: IssuerTests.cs
View license
[Test]
        public async Task CanRetrieveIssuerList() {
            // When: Retrieve payment list with default settings
            ListResponse<IssuerResponse> issuerList = await this._issuerClient.GetIssuerListAsync();

            // Then
            Assert.IsNotNull(issuerList);
        }

47. Example

Project: MollieApi
Source File: MandateTests.cs
View license
[Test]
        public async Task CanRetrieveMandateList() {
            // We can only test this if there are customers
            ListResponse<CustomerResponse> customers = await this._customerClient.GetCustomerListAsync();

            if (customers.TotalCount > 0) {
                // When: Retrieve mandate list with default settings
                ListResponse<MandateResponse> response = await this._mandateClient.GetMandateListAsync(customers.Data.First().Id);

                // Then
                Assert.IsNotNull(response);
            }
        }

48. Example

Project: MollieApi
Source File: PaymentTests.cs
View license
[Test]
        public async Task CanRetrievePaymentList() {
            // When: Retrieve payment list with default settings
            ListResponse<PaymentResponse> response = await this._paymentClient.GetPaymentListAsync();

            // Then
            Assert.IsNotNull(response);
        }

49. Example

Project: MollieApi
Source File: CustomerTests.cs
View license
[Test]
        public async Task CanRetrieveCustomerList() {
            // When: Retrieve customer list with default settings
            ListResponse<CustomerResponse> response = await this._customerClient.GetCustomerListAsync();

            // Then
            Assert.IsNotNull(response);
        }

50. Example

Project: OwinFriendlyExceptions
Source File: Tests.cs
View license
[Test]
        public void LambdaMatcherMatchesDerived()
        {
            var builder = TransformsCollectionBuilder.Begin()
                .Map(ex => ex.GetType().IsSubclassOf(typeof(Exception)))
                .To(HttpStatusCode.OK, "Success", (ex) => ex.Message);

            var coll = builder.Done();

            var testException = new ArgumentException("ok");

            Assert.IsNotNull(coll.FindTransform(testException));
        }