protected override void ExecuteBenchmark(IResolveScope scope)
 {
     using (var childScope = scope.CreateScope())
     {
         childScope.Resolve(typeof(ISmallObjectService));
     }
 }
        protected override void Warmup(IResolveScope scope)
        {
            using (var childScope = scope.CreateScope())
            {
                var instance = childScope.Resolve <IImportMultipleSmallObject>();

                if (!ReferenceEquals(instance.SmallObject1, instance.SmallObject2))
                {
                    throw new Exception("Not the same instance");
                }

                var instance2 = childScope.Resolve <IImportMultipleSmallObject>();

                if (ReferenceEquals(instance, instance2))
                {
                    throw new Exception("Same instance");
                }

                if (!ReferenceEquals(instance.SmallObject1, instance2.SmallObject1))
                {
                    throw new Exception("Small object1 not same instance");
                }

                if (!ReferenceEquals(instance.SmallObject2, instance2.SmallObject2))
                {
                    throw new Exception("Small object2 not same instance");
                }
            }
        }
Beispiel #3
0
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     if (scope.Resolve <Lazy <ISmallObjectService> >().Value == null)
     {
         throw new Exception("Null lazy value");
     }
 }
Beispiel #4
0
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     if (scope.Resolve <ImmutableList <IEnumerableService> >().Count() != 5)
     {
         throw new Exception("Count does not equal 5");
     }
 }
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     using (var childScope = scope.CreateScope())
     {
         childScope.Resolve(typeof(IImportMultipleSmallObject));
     }
 }
Beispiel #6
0
        protected override void Warmup(IResolveScope scope)
        {
            var instance = scope.Resolve <IImportMultipleSmallObject>();

            if (!ReferenceEquals(instance.SmallObject1, instance.SmallObject2))
            {
                throw new Exception("Not the same instance");
            }
        }
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve(typeof(IOneArgeFactoryService));
 }
Beispiel #8
0
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve(typeof(ISingletonService));
 }
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve(typeof(ILargeComplexService));
 }
 public static T Resolve <T>(this IResolveScope scope)
 {
     return((T)scope.Resolve(typeof(T)));
 }
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve <Func <int, string, ITransientService, IThreeArgService1> >()(5, "Hello",
                                                                                 new TransientService());
 }
Beispiel #12
0
 protected virtual void Warmup(IResolveScope scope)
 {
     ExecuteBenchmark(scope);
 }
Beispiel #13
0
 private void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve(typeof(ISmallObjectService));
 }
Beispiel #14
0
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve(typeof(IImportMultipleSmallObject));
 }
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve(typeof(IGenericObjectService <ISmallObjectService>));
 }
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve(typeof(IThreeArgRefService));
 }
Beispiel #17
0
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve <ISmallObjectService>();
 }
Beispiel #18
0
 protected abstract void ExecuteBenchmark(IResolveScope scope);
 protected override void ExecuteBenchmark(IResolveScope scope)
 {
     scope.Resolve <Func <ITransientService, ISmallObjectService> >()(new TransientService());
 }