NUnit.Framework.Assert.IsInstanceOfType(System.Type, object)

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

184 Examples 7

1. Example

Project: JsonConfig
Source File: MergerTests.cs
View license
[Test]
		public void MergeTwoNullExceptionPreventer ()
		{
			var n1 = new NullExceptionPreventer ();
			var n2 = new NullExceptionPreventer ();
			dynamic merged = Merger.Merge (n1, n2);
			Assert.IsInstanceOfType (typeof(ConfigObject), merged);
		}

2. Example

Project: JsonConfig
Source File: MergerTests.cs
View license
[Test]
		public void BothObjectsAreNull ()
		{
			dynamic result = JsonConfig.Merger.Merge (null, null);
			Assert.IsInstanceOfType (typeof(ConfigObject), result);
		}

3. Example

View license
public static void ShouldBeOfType(this object actual, Type expected)
        {
            Assert.IsInstanceOfType(expected, actual);
        }

4. Example

View license
[Test]
        public void GetStrategy_should_return_correct_utc_time_implementation()
        {
            //  arrange
            _configManager.AppSettings[AppSettingKeys.VersionStrategy] = VersionStrategyFactory.UtcTime;

            //  act
            IVersionStrategy strategy = _subject.GetStrategy();

            //  assert
            Assert.IsInstanceOfType(typeof(UtcTimestampVersion), strategy);
        }

5. Example

View license
[Test]
        public void GetStrategy_should_return_correct_seq_num_implementation()
        {
            //  arrange
            _configManager.AppSettings[AppSettingKeys.VersionStrategy] = VersionStrategyFactory.SequentialNumber;

            //  act
            IVersionStrategy strategy = _subject.GetStrategy();

            //  assert
            Assert.IsInstanceOfType(typeof(SequentialNumberVersion), strategy);
        }

6. Example

View license
[Test]
        public void GetStrategy_should_return_correct_local_time_implementation()
        {
            //  arrange
            _configManager.AppSettings[AppSettingKeys.VersionStrategy] = VersionStrategyFactory.LocalTime;

            //  act
            IVersionStrategy strategy = _subject.GetStrategy();

            //  assert
            Assert.IsInstanceOfType(typeof(LocalTimestampVersion), strategy);
        }

7. Example

Project: keepassrpc
Source File: TestNullableImporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ImporterBase), new NullableImporter(typeof(int?)));
        }

8. Example

View license
[Test]
        public void ImplementsINonObjectMemberImporter()
        {
            Assert.IsInstanceOfType(typeof(INonObjectMemberImporter), new Surrogate(new object()));
        }

9. Example

Project: keepassrpc
Source File: TestDateTimeExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new DateTimeExporter());    
        }

10. Example

Project: keepassrpc
Source File: TestDataSetExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new DataSetExporter());
        }

11. Example

Project: keepassrpc
Source File: TestBooleanExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new BooleanExporter());
        }

12. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new JsonBufferExporter());
        }

13. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new ExpandoObjectExporter());
        }

14. Example

Project: keepassrpc
Source File: TestDataTableExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new DataTableExporter());
        }

15. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new DictionaryExporter(typeof(Hashtable)));    
        }

16. Example

Project: keepassrpc
Source File: TestNullableExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new NullableExporter(typeof(int?)));
        }

17. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ImporterBase), new ExpandoObjectImporter());
        }

18. Example

View license
[ Test ]
        public void ImplementsIObjectSurrogateConstructor()
        {
            Assert.IsInstanceOfType(typeof(IObjectSurrogateConstructor), new Surrogate(new object()));
        }

19. Example

Project: keepassrpc
Source File: TestTupleExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new TupleExporter(typeof(Tuple<object>)));
        }

20. Example

Project: keepassrpc
Source File: TestStringExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new StringExporter());
        }

21. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new JsonNumberExporter());
        }

22. Example

Project: keepassrpc
Source File: TestTupleImporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ImporterBase), new TupleImporter(typeof(Tuple<object>)));
        }

23. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new EnumerableExporter(typeof(Array)));    
        }

24. Example

View license
[Test]
        public void Registering_with_implementation_should_override_the_previous_registration()
        {
            locator.Register<IRepository, ProductRepository>();
            locator.Register<IRepository, AccountRepository>();
            var instance = locator.Resolve<IRepository>();
            Assert.IsInstanceOfType(typeof(AccountRepository), instance);
        }

25. Example

View license
[Test]
        public void Registering_with_keyed_implementation_should_override_the_previous_registration_when_resolve_is_called_inbetween()
        {
            locator.Register<IRepository, ProductRepository>("key");
            locator.Resolve<IRepository>("key");
            locator.Register<IRepository, AccountRepository>("key");
            var instance = locator.Resolve<IRepository>("key");
            Assert.IsInstanceOfType(typeof(AccountRepository), instance);            
        }

26. Example

View license
[Test]
        public void Registering_with_implementation_should_override_the_previous_registration_when_resolve_is_called_inbetween()
        {
            locator.Register<IRepository, ProductRepository>();
            locator.Resolve<IRepository>();
            locator.Register<IRepository, AccountRepository>();
            var instance = locator.Resolve<IRepository>();
            Assert.IsInstanceOfType(typeof(AccountRepository), instance);
        }

27. Example

View license
[Test]
        public void Registering_with_specified_type_should_override_the_previous_registration_when_resolve_is_called_inbetween()
        {
            locator.Register<IRepository>(typeof (ProductRepository));
            locator.Resolve<IRepository>();
            locator.Register<IRepository>(typeof (AccountRepository));
            var instance = locator.Resolve<IRepository>();
            Assert.IsInstanceOfType(typeof(AccountRepository), instance);
        }

28. Example

View license
[Test]
        public void Registering_with_specified_service_and_type_should_override_the_previous_registration_when_resolve_is_called_inbetween()
        {
            locator.Register(typeof(IRepository), typeof(ProductRepository));
            locator.Resolve<IRepository>();
            locator.Register(typeof(IRepository), typeof(AccountRepository));
            var instance = locator.Resolve<IRepository>();
            Assert.IsInstanceOfType(typeof(AccountRepository), instance);
        }

29. Example

Project: machine
Source File: DeferredContainerTests.cs
View license
[Test]
    public void Resolve_JustService1ByInterface_GetsService()
    {
      _target.AddComponent("Service1", typeof(Service1));
      Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<IService1>());
    }

30. Example

Project: machine
Source File: DeferredContainerTests.cs
View license
[Test]
    public void Resolve_Service2DependsOnService1ByInterface_GetsService()
    {
      _target.AddComponent("Service1", typeof(Service1));
      _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
      Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<IService2>());
      Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<IService1>());
    }

31. Example

View license
[Test]
    public void CreateActivatorInstance_ReturnsInstanceActivator_ReturnsSameOne()
    {
      Assert.IsInstanceOfType(typeof(StaticActivator), _activatorFactory.CreateStaticActivator(_entry, new SimpleService1()));
    }

32. Example

Project: machine
Source File: DeferredContainerTests.cs
View license
[Test]
    public void Resolve_TwoService1DependentsThatMightCauseItToNotCheckAgainAndResolveByInterface_GetsService()
    {
      _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
      _target.AddComponent("Service3DependsOnService1And2", typeof(Service3DependsOnService1And2));
      _target.AddComponent("Service1", typeof(Service1));
      Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<IService2>());
      Assert.IsInstanceOfType(typeof(Service3DependsOnService1And2), _target.Resolve<IService3>());
      Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<IService1>());
    }

33. Example

Project: machine
Source File: DeferredContainerTests.cs
View license
[Test]
    public void Resolve_Service2DependsOnService1ByImplementation_GetsService()
    {
      _target.AddComponent("Service1", typeof(Service1));
      _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
      Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<Service2DependsOnService1>());
      Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<Service1>());
    }

34. Example

Project: machine
Source File: DeferredContainerTests.cs
View license
[Test]
    public void Resolve_JustService1ByImplementation_GetsService()
    {
      _target.AddComponent("Service1", typeof(Service1));
      Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<Service1>());
    }

35. Example

Project: machine
Source File: LifestyleFactoryTests.cs
View license
[Test]
    public void CreateTransientLifestyle_Always_ReturnsNewLifestyle()
    {
      Assert.IsInstanceOfType(typeof(TransientLifestyle), _target.CreateTransientLifestyle(ServiceEntryHelper.NewEntry()));
    }

36. Example

Project: machine
Source File: LifestyleFactoryTests.cs
View license
[Test]
    public void CreateSingletonLifestyle_Always_ReturnsNewLifestyle()
    {
      Assert.IsInstanceOfType(typeof(SingletonLifestyle), _target.CreateSingletonLifestyle(ServiceEntryHelper.NewEntry()));
    }

37. Example

Project: machine
Source File: LifestyleFactoryTests.cs
View license
[Test]
    public void CreateLifestyle_Singleton_ReturnsNewLifestyle()
    {
      Assert.IsInstanceOfType(typeof(SingletonLifestyle), _target.CreateLifestyle(ServiceEntryHelper.NewEntry()));
    }

38. Example

Project: machine
Source File: DeferredContainerTests.cs
View license
[Test]
    public void Resolve_TwoService1DependentsThatMightCauseItToNotCheckAgainAndResolveByImplementation_GetsService()
    {
      _target.AddComponent("Service2DependsOnService1", typeof(Service2DependsOnService1));
      _target.AddComponent("Service3DependsOnService1And2", typeof(Service3DependsOnService1And2));
      _target.AddComponent("Service1", typeof(Service1));
      Assert.IsInstanceOfType(typeof(Service2DependsOnService1), _target.Resolve<Service2DependsOnService1>());
      Assert.IsInstanceOfType(typeof(Service3DependsOnService1And2), _target.Resolve<Service3DependsOnService1And2>());
      Assert.IsInstanceOfType(typeof(Service1), _target.Resolve<Service1>());
    }

39. Example

Project: machine
Source File: LifestyleFactoryTests.cs
View license
[Test]
    public void CreateLifestyle_Transient_ReturnsNewLifestyle()
    {
      Assert.IsInstanceOfType(typeof(TransientLifestyle), _target.CreateLifestyle(ServiceEntryHelper.NewEntry(LifestyleType.Transient)));
    }

40. Example

View license
[Test]
    public void CreateDefaultActivator_Always_Is_Property_Setting_Activator_For_Now()
    {
      Assert.IsInstanceOfType(typeof(PropertySettingActivator), _activatorFactory.CreateDefaultActivator(_entry));
    }

41. Example

Project: Jayrock
Source File: TestJsonNumberExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new JsonNumberExporter());
        }

42. Example

Project: Jayrock
Source File: TestTupleExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new TupleExporter(typeof(Tuple<object>)));
        }

43. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ImporterBase), new ExpandoObjectImporter());
        }

44. Example

View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new ExpandoObjectExporter());
        }

45. Example

Project: Jayrock
Source File: TestStringExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new StringExporter());
        }

46. Example

View license
[ Test ]
        public void DefaultImplementationCreatesJsonRpcDispatcher()
        {
            Assert.IsInstanceOfType(typeof(JsonRpcDispatcher), JsonRpcDispatcherFactory.Default(new TestService()));
        }

47. Example

View license
[Test]
        public void ImplementsINonObjectMemberImporter()
        {
            Assert.IsInstanceOfType(typeof(INonObjectMemberImporter), new Surrogate(new object()));
        }

48. Example

View license
[ Test ]
        public void ImplementsIObjectSurrogateConstructor()
        {
            Assert.IsInstanceOfType(typeof(IObjectSurrogateConstructor), new Surrogate(new object()));
        }

49. Example

Project: Jayrock
Source File: TestTupleImporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ImporterBase), new TupleImporter(typeof(Tuple<object>)));
        }

50. Example

Project: Jayrock
Source File: TestDataTableExporter.cs
View license
[ Test ]
        public void Superclass()
        {
            Assert.IsInstanceOfType(typeof(ExporterBase), new DataTableExporter());
        }