NUnit.Framework.Assert.IsInstanceOf(object)

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

200 Examples 7

51. Example

Project: couchbase-net-client
Source File: DefaultSerializerTests.cs
[Test]
        public void JsonSettings_With_Null_ContractResolver_Uses_JsonConvert_Default_ContractResolver_If_Available()
        {
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            };

            var deserializationSettings = new JsonSerializerSettings
            {
                ContractResolver = null
            };
            var serializationSettings = new JsonSerializerSettings
            {
                ContractResolver = null
            };

            var serializer = new DefaultSerializer(deserializationSettings, serializationSettings);

            Assert.IsInstanceOf<CamelCasePropertyNamesContractResolver>(serializer.DeserializationSettings.ContractResolver);
            Assert.IsInstanceOf<CamelCasePropertyNamesContractResolver>(serializer.SerializerSettings.ContractResolver);
        }

52. Example

Project: couchbase-net-client
Source File: OperationResultTests.cs
[Test]
        public void SetException_KeyNotFound_Sets_DocumentDoesNotExistException()
        {
            var result = new OperationResult
            {
                Status = ResponseStatus.KeyNotFound
            };

            result.SetException();
            Assert.IsInstanceOf<DocumentDoesNotExistException>(result.Exception);
        }

53. Example

Project: couchbase-net-client
Source File: OperationResultTests.cs
[Test]
        public void SetException_KeyNotFound_Sets_CasMismatchException_When_Not_Add()
        {
            var result = new OperationResult
            {
                Status = ResponseStatus.KeyExists,
                OpCode = OperationCode.Get
            };

            result.SetException();
            Assert.IsInstanceOf<CasMismatchException>(result.Exception);
        }

54. Example

Project: couchbase-net-client
Source File: OperationResultTests.cs
[Test]
        public void SetException_KeyNotFound_Sets_DocumentAlreadyExistsException()
        {
            var result = new OperationResult
            {
                Status = ResponseStatus.KeyExists,
                OpCode = OperationCode.Add
            };

            result.SetException();
            Assert.IsInstanceOf<DocumentAlreadyExistsException>(result.Exception);
        }

55. Example

Project: couchbase-net-client
Source File: BooleanQueryTests.cs
[Test]
        public void Boost_ReturnsBooleanQuery()
        {
            var query = new BooleanQuery().Boost(2.2);

            Assert.IsInstanceOf<BooleanQuery>(query);
        }

56. Example

Project: couchbase-net-client
Source File: ConjunctionQueryTests.cs
[Test]
        public void Boost_ReturnsConjunctionQuery()
        {
            var query = new ConjunctionQuery().Boost(2.2);

            Assert.IsInstanceOf<ConjunctionQuery> (query);
        }

57. Example

Project: couchbase-net-client
Source File: DateRangeQueryTests.cs
[Test]
        public void Boost_ReturnsDateRangeQuery()
        {
            var query = new DateRangeQuery().Boost(2.2);

            Assert.IsInstanceOf<DateRangeQuery> (query);
        }

58. Example

Project: couchbase-net-client
Source File: DisjunctionQueryTests.cs
[Test]
        public void Boost_ReturnsDisjunctionQuery()
        {
            var query = new DisjunctionQuery().Boost(2.2);

            Assert.IsInstanceOf<DisjunctionQuery> (query);
        }

59. Example

Project: couchbase-net-client
Source File: MatchPhraseQueryTests.cs
[Test]
        public void Boost_ReturnsMatchPhraseQuery()
        {
            var query = new MatchPhraseQuery("phrase").Boost(2.2);

            Assert.IsInstanceOf<MatchPhraseQuery> (query);
        }

60. Example

Project: couchbase-net-client
Source File: MatchQueryTests.cs
[Test]
        public void Boost_ReturnsPrefixQuery()
        {
            var query = new MatchQuery("somematchquery").Boost(2.2);

            Assert.IsInstanceOf<MatchQuery> (query);
        }

61. Example

Project: couchbase-net-client
Source File: NumericRangeQueryTests.cs
[Test]
        public void Boost_Returns_NumericRangeQuery()
        {
            var query = new NumericRangeQuery().Boost(2.2);

            Assert.IsInstanceOf<NumericRangeQuery> (query);
        }

62. Example

Project: couchbase-net-client
Source File: PrefixQueryTests.cs
[Test]
        public void Boost_ReturnsPrefixQuery()
        {
            var query = new PrefixQuery("prefix").Boost(2.2);

            Assert.IsInstanceOf<PrefixQuery> (query);
        }

63. Example

Project: couchbase-net-client
Source File: QueryStringQueryTests.cs
[Test]
        public void Boost_ReturnsStringQuery()
        {
            var query = new QueryStringQuery("description:water and some other stuff").Boost(2.2);

            Assert.IsInstanceOf<QueryStringQuery> (query);
        }

64. Example

Project: couchbase-net-client
Source File: RegexpQueryTests.cs
[Test]
        public void Boost_ReturnsRegexQuery()
        {
            var query = new RegexpQuery("*").Boost(2.2);

            Assert.IsInstanceOf<RegexpQuery> (query);
        }

65. Example

Project: couchbase-net-client
Source File: TermQueryTests.cs
[Test]
        public void Boost_ReturnsFuzzyQuery()
        {
            var query = new TermQuery("theterm").Boost(2.2);

            Assert.IsInstanceOf<TermQuery> (query);
        }

66. Example

Project: couchbase-net-client
Source File: OperationResultTests.cs
[Test]
        public void SetException_Should_Set_DocumentDoesNotExistException_When_Status_Is_KeyNotFound()
        {
            var operationResult = new OperationResult
            {
                Success = false,
                Status = ResponseStatus.KeyNotFound
            };

            operationResult.SetException();

            Assert.IsInstanceOf<DocumentDoesNotExistException>(operationResult.Exception);
        }

67. Example

Project: couchbase-net-client
Source File: OperationResultTests.cs
[Test]
        public void SetException_Should_Set_DocumentAlreadyExistsException_When_Status_Is_KeyExists_And_OpCode_Is_Add()
        {
            var operationResult = new OperationResult
            {
                Success = false,
                Status = ResponseStatus.KeyExists,
                OpCode = OperationCode.Add
            };

            operationResult.SetException();

            Assert.IsInstanceOf<DocumentAlreadyExistsException>(operationResult.Exception);
        }

68. Example

Project: couchbase-net-client
Source File: OperationResultTests.cs
[Test]
        public void SetException_Should_Set_CasMismatchException_When_Status_Is_DocumentMutationDetected()
        {
            var operationResult = new OperationResult
            {
                Success = false,
                Status = ResponseStatus.DocumentMutationDetected
            };

            operationResult.SetException();
            Assert.IsInstanceOf<CasMismatchException>(operationResult.Exception);
        }

69. Example

Project: couchbase-net-client
Source File: OperationResultTests.cs
[TestCase(ResponseStatus.ValueTooLarge)]
        [TestCase(ResponseStatus.InvalidArguments)]
        [TestCase(ResponseStatus.ItemNotStored)]
        [TestCase(ResponseStatus.IncrDecrOnNonNumericValue)]
        [TestCase(ResponseStatus.VBucketBelongsToAnotherServer)]
        [TestCase(ResponseStatus.AuthenticationError)]
        [TestCase(ResponseStatus.AuthenticationContinue)]
        [TestCase(ResponseStatus.InvalidRange)]
        [TestCase(ResponseStatus.UnknownCommand)]
        [TestCase(ResponseStatus.OutOfMemory)]
        [TestCase(ResponseStatus.NotSupported)]
        [TestCase(ResponseStatus.InternalError)]
        [TestCase(ResponseStatus.Busy)]
        [TestCase(ResponseStatus.TemporaryFailure)]
        public void SetException_Should_Set_TemporaryLockFailureException_When_Message_Contatains_LOCKED(ResponseStatus status)
        {
            var operationResult = new OperationResult
            {
                Success = false,
                Status = status,
                Message = "error - LOCK_ERROR"
            };

            operationResult.SetException();
            Assert.IsInstanceOf<TemporaryLockFailureException>(operationResult.Exception);
        }

70. Example

Project: csunits
Source File: QuantityAdapterTests.cs
[Test]
        public void QuantityGetter_CompareWithQuantityUsedInConstructor_AreEqual()
        {
            var actual = _instance.Quantity;
            Assert.IsInstanceOf<Force>(actual);
        }

71. Example

Project: csunits
Source File: IMeasureTests.cs
[Test]
        public void UnitGetter_ValidateReturnType_SupportsNonGeneric()
        {
            var expected = typeof (IUnit);
            var actual = _instance.Unit;
            Assert.IsInstanceOf(expected, actual);
        }

72. Example

Project: csunits
Source File: MeasureTripletTests.cs
[Test]
        public void IMeasureXAccessor_CheckReturnType_ShouldBeIMeasure()
        {
            var expected = typeof(IMeasure<Time>);
            IMeasureTriplet<Time, Power, ElectricPotential> triplet = _instance;
            var actual = triplet.X;
            Assert.IsInstanceOf(expected, actual);
        }

73. Example

Project: csunits
Source File: UnitTests.cs
[Test]
        public void Quantity_OfLengthUnit_IsLength()
        {
            Assert.IsInstanceOf(typeof(Length), Length.PicoMeter.Quantity);
        }

74. Example

Project: csunits
Source File: UnitTests.cs
[Test]
        public void Quantity_OfIUnitDefinedAsMassUnit_IsMass()
        {
            IUnit unit = Mass.HectoGram;
            Assert.IsInstanceOf(typeof(Mass), unit.Quantity);
        }

75. Example

Project: CSMSL
Source File: MassTestFixture.cs
[Test]
        public void MassIsIMass()
        {
            Mass m1 = new Mass(524.342);

            Assert.IsInstanceOf<IMass>(m1);
        }

76. Example

Project: OrigoDB
Source File: EngineConfigurationTest.cs
[Test]
        public void PacketingFormatterIsReturnedWhenPaketOptionsArePresent()
        {
            var config = new EngineConfiguration();
            config.PacketOptions = PacketOptions.Checksum;
            config.SetFormatterFactory((c,f) => new BinaryFormatter());
            var actual = config.CreateFormatter(FormatterUsage.Journal);
            Assert.IsInstanceOf<PacketingFormatter>(actual);
        }

77. Example

Project: OrigoDB
Source File: EngineTest.cs
[Test]
        public void CanGetModelReference()
        {
            var config = new EngineConfiguration().ForIsolatedTest();
            var engine = Engine.Create<TestModel>(config);
            engine.Execute(new TestCommandWithoutResult());
            var model = engine.GetModel();
            Assert.IsInstanceOf(typeof(TestModel), model);
        }

78. Example

Project: OrigoDB
Source File: RolloverTests.cs
[Test]
        public void CompositeIsDefault()
        {
            var config = new EngineConfiguration();
            var strategy = config.CreateRolloverStrategy();
            Assert.IsInstanceOf<CompositeRolloverStrategy>(strategy);
        }

79. Example

Project: OrigoDB
Source File: StoreTests.cs
[Test]
        public void Can_load_from_journal_with_ModelCreatedEntry()
        {
            JournalAppender.Create(0, _commandStore).AppendModelCreated(typeof(ImmutableModel));
            Model model = new ModelLoader(_config, _commandStore).LoadModel();
            Assert.IsInstanceOf<ImmutableModel>(model);
        }

80. Example

Project: Dnn.Platform
Source File: PagingExtensionsTests.cs
[Test]
        public void PagingExtensions_InPagesOf_Returns_PageSelector()
        {
            //Arrange
            IQueryable<int> queryable = Util.CreateIntegerList(Constants.PAGE_TotalCount).AsQueryable();

            //Act
            PageSelector<int> pageSelector = queryable.InPagesOf(Constants.PAGE_RecordCount);

            //Assert
            Assert.IsInstanceOf<PageSelector<int>>(pageSelector);
        }

81. Example

Project: Dnn.Platform
Source File: PagingExtensionsTests.cs
[Test]
        [TestCase(0, 5)]
        [TestCase(0, 6)]
        [TestCase(2, 4)]
        [TestCase(4, 4)]
        public void PagingExtensions_ToPagedList_Returns_PagedList_From_Enumerable(int index, int pageSize)
        {
            //Arrange
            List<int> enumerable = Util.CreateIntegerList(Constants.PAGE_TotalCount);

            //Act
            IPagedList<int> pagedList = enumerable.ToPagedList(index, pageSize);

            //Assert
            Assert.IsInstanceOf<IPagedList<int>>(pagedList);
        }

82. Example

Project: Dnn.Platform
Source File: PagingExtensionsTests.cs
[Test]
        [TestCase(0, 5)]
        [TestCase(0, 6)]
        [TestCase(2, 4)]
        [TestCase(4, 4)]
        public void PagingExtensions_ToPagedList_Returns_PagedList_From_Queryable(int index, int pageSize)
        {
            //Arrange
            IQueryable<int> queryable = Util.CreateIntegerList(Constants.PAGE_TotalCount).AsQueryable();

            //Act
            IPagedList<int> pagedList = queryable.ToPagedList(index, pageSize);

            //Assert
            Assert.IsInstanceOf<IPagedList<int>>(pagedList);
        }

83. Example

Project: Dnn.Platform
Source File: DataContextTests.cs
[Test]
        public void DataContext_Instance_Method_Returns_PetaPocoDataContext()
        {
            //Arrange

            //Act
            var context = DataContext.Instance();

            //Assert
            Assert.IsInstanceOf<IDataContext>(context);
            Assert.IsInstanceOf<PetaPocoDataContext>(context);
        }

84. Example

Project: Dnn.Platform
Source File: DataProviderTests.cs
[Test]
        public void DataProvider_Instance_Method_Returns_Instance()
        {
            //Arrange
            ComponentFactory.Container = new SimpleContainer();
            ComponentFactory.RegisterComponentInstance<DataProvider>(new FakeDataProvider(new Dictionary<string, string>()));

            //Act
            var provider = DataProvider.Instance();

            //Assert
            Assert.IsInstanceOf<DataProvider>(provider);
            Assert.IsInstanceOf<FakeDataProvider>(provider);
        }

85. Example

Project: Dnn.Platform
Source File: FluentMapperTests.cs
[Test]
        public void FluentMapper_GetTableInfo_Returns_TableInfo()
        {
            //Arrange
            var mapper = new FluentMapper<Dog>(Constants.TABLENAME_Prefix);

            //Act
            var ti = mapper.GetTableInfo(typeof(Dog));

            //Assert
            Assert.IsInstanceOf<TableInfo>(ti);
        }

86. Example

Project: Dnn.Platform
Source File: PetaPocoDataContextTests.cs
[Test]
        public void PetaPocoDataContext_Constructor_Initialises_Database_Property()
        {
            //Arrange

            //Act
            var context = new PetaPocoDataContext(connectionStringName);

            //Assert
            Assert.IsInstanceOf<Database>(Util.GetPrivateMember<PetaPocoDataContext, Database>(context, "_database"));
        }

87. Example

Project: Dnn.Platform
Source File: PetaPocoDataContextTests.cs
[Test]
        public void PetaPocoDataContext_Constructor_Initialises_Mapper_Property()
        {
            //Arrange

            //Act
            var context = new PetaPocoDataContext(connectionStringName);

            //Assert
            Assert.IsInstanceOf<IMapper>(Util.GetPrivateMember<PetaPocoDataContext, IMapper>(context, "_mapper"));
            Assert.IsInstanceOf<PetaPocoMapper>(Util.GetPrivateMember<PetaPocoDataContext, PetaPocoMapper>(context, "_mapper"));
        }

88. Example

Project: Dnn.Platform
Source File: PetaPocoDataContextTests.cs
[Test]
        public void PetaPocoDataContext_GetRepository_Returns_Repository()
        {
            //Arrange
            var context = new PetaPocoDataContext(connectionStringName);

            //Act
            var repo = context.GetRepository<Dog>();

            //Assert
            Assert.IsInstanceOf<IRepository<Dog>>(repo);
            Assert.IsInstanceOf<PetaPocoRepository<Dog>>(repo);
        }

89. Example

Project: Dnn.Platform
Source File: PetaPocoDataContextTests.cs
[Test]
        public void PetaPocoDataContext_GetRepository_Sets_Repository_Database_Property()
        {
            //Arrange
            var context = new PetaPocoDataContext(connectionStringName);

            //Act
            var repo = (PetaPocoRepository<Dog>)context.GetRepository<Dog>();

            //Assert
            Assert.IsInstanceOf<Database>(Util.GetPrivateMember<PetaPocoRepository<Dog>, Database>(repo, "_database"));
        }

90. Example

Project: Dnn.Platform
Source File: PetaPocoDataContextTests.cs
[Test]
        public void PetaPocoDataContext_GetRepository_Uses_PetaPocoMapper_If_No_FluentMapper()
        {
            //Arrange
            var context = new PetaPocoDataContext(connectionStringName);

            //Act
            var repo = (PetaPocoRepository<Dog>)context.GetRepository<Dog>();

            //Assert
            Assert.IsInstanceOf<IMapper>(Util.GetPrivateMember<PetaPocoRepository<Dog>, IMapper>(repo, "_mapper"));
            Assert.IsInstanceOf<PetaPocoMapper>(Util.GetPrivateMember<PetaPocoRepository<Dog>, IMapper>(repo, "_mapper"));
        }

91. Example

Project: Dnn.Platform
Source File: PetaPocoDataContextTests.cs
[Test]
        public void PetaPocoDataContext_GetRepository_Uses_FluentMapper_If_FluentMapper_Defined()
        {
            //Arrange
            var context = new PetaPocoDataContext(connectionStringName);
            context.AddFluentMapper<Dog>();

            //Act
            var repo = (PetaPocoRepository<Dog>)context.GetRepository<Dog>();

            //Assert
            Assert.IsInstanceOf<IMapper>(Util.GetPrivateMember<PetaPocoRepository<Dog>, IMapper>(repo, "_mapper"));
            Assert.IsInstanceOf<FluentMapper<Dog>>(Util.GetPrivateMember<PetaPocoRepository<Dog>, IMapper>(repo, "_mapper"));
        }

92. Example

Project: Dnn.Platform
Source File: PetaPocoMapperTests.cs
[Test]
        public void PetaPocoMapper_GetTableInfo_Returns_TableInfo()
        {
            //Arrange
            var mapper = new PetaPocoMapper(Constants.TABLENAME_Prefix);

            //Act
            var ti = mapper.GetTableInfo(typeof(Dog));

            //Assert
            Assert.IsInstanceOf<TableInfo>(ti);
        }

93. Example

Project: Dnn.Platform
Source File: ResultAssert.cs
public static void IsEmpty(ActionResult result)
        {
            Assert.IsInstanceOf<EmptyResult>(result);
        }

94. Example

Project: Dnn.Platform
Source File: ResultAssert.cs
public static void IsUnauthorized(ActionResult result)
        {
            Assert.IsInstanceOf<HttpUnauthorizedResult>(result);
        }

95. Example

Project: DustedCodes
Source File: AtomFeedResultTests.cs
[Test]
        public void Class_Inherits_From_FeedResult()
        {
            var feed = Builder<SyndicationFeed>.CreateNew().Build();

            var result = new AtomFeedResult(feed);

            Assert.IsInstanceOf<FeedResult>(result);
        }

96. Example

Project: DustedCodes
Source File: RssFeedResultTests.cs
[Test]
        public void Class_Inherits_From_FeedResult()
        {
            var feed = Builder<SyndicationFeed>.CreateNew().Build();

            var result = new RssFeedResult(feed);

            Assert.IsInstanceOf<FeedResult>(result);
        }

97. Example

Project: EasyNetQ.Management.Client
Source File: TestExtensions.cs
public static void ShouldBe<T>(this object actual)
        {
            Assert.IsInstanceOf<T>(actual);
        }

98. Example

Project: EasyNetQ.Management.Client
Source File: TestExtensions.cs
public static void ShouldBe<T>(this object actual)
        {
            Assert.IsInstanceOf<T>(actual);
        }

99. Example

Project: fluent-command-line-parser
Source File: CommandLineOptionParserFactoryTests.cs
[Test]
		public void Ensure_Factory_Supports_Out_Of_The_Box_Parsers()
		{
			var factory = new CommandLineOptionParserFactory();

			var stringParser = factory.CreateParser<string>();
			var int32Parser = factory.CreateParser<int>();
            var int64Parser = factory.CreateParser<long>();
			var doubleParser = factory.CreateParser<double>();
			var dtParser = factory.CreateParser<DateTime>();
			var boolParser = factory.CreateParser<bool>();

			Assert.IsInstanceOf<StringCommandLineOptionParser>(stringParser);
			Assert.IsInstanceOf<Int32CommandLineOptionParser>(int32Parser);
            Assert.IsInstanceOf<Int64CommandLineOptionParser>(int64Parser);
			Assert.IsInstanceOf<DoubleCommandLineOptionParser>(doubleParser);
			Assert.IsInstanceOf<DateTimeCommandLineOptionParser>(dtParser);
			Assert.IsInstanceOf<BoolCommandLineOptionParser>(boolParser);
		}

100. Example

Project: fluent-command-line-parser
Source File: CommandLineOptionParserFactoryTests.cs
[Test]
        public void Ensure_Factory_Supports_List_Of_Int64()
        {
            var factory = new CommandLineOptionParserFactory();

            var int64ListParser = factory.CreateParser<System.Collections.Generic.List<long>>();

            Assert.IsInstanceOf<ListCommandLineOptionParser<long>>(int64ListParser);
        }