コード例 #1
0
        public void NativeModuleRegistry_Override_Disallowed()
        {
            var builder = new NativeModuleRegistry.Builder(new ReactContext());

            builder.Add(new OverrideDisallowedModule());
            AssertEx.Throws <InvalidOperationException>(() => builder.Add(new OverrideDisallowedModule()));
        }
コード例 #2
0
 public void NativeModuleRegistry_ModuleWithNullName_Throws()
 {
     var builder = new NativeModuleRegistry.Builder();
     AssertEx.Throws<ArgumentException>(
         () => builder.Add(new NullNameModule()),
         ex => Assert.AreEqual("module", ex.ParamName));
 }
コード例 #3
0
 public void NativeModuleRegistry_ArgumentChecks()
 {
     var builder = new NativeModuleRegistry.Builder();
     AssertEx.Throws<ArgumentNullException>(
         () => builder.Add(null),
         ex => Assert.AreEqual("module", ex.ParamName));
 }
コード例 #4
0
        public void NativeModuleRegistry_ModuleWithNullName_Throws()
        {
            var builder = new NativeModuleRegistry.Builder(new ReactContext());

            AssertEx.Throws <ArgumentException>(
                () => builder.Add(new NullNameModule()),
                ex => Assert.AreEqual("module", ex.ParamName));
        }
コード例 #5
0
        public void NativeModuleRegistry_ArgumentChecks()
        {
            var builder = new NativeModuleRegistry.Builder();

            AssertEx.Throws <ArgumentNullException>(
                () => builder.Add(null),
                ex => Assert.AreEqual("module", ex.ParamName));
        }
コード例 #6
0
 private void ProcessPackage(
     IReactPackage reactPackage,
     ReactContext reactContext,
     NativeModuleRegistry.Builder nativeRegistryBuilder)
 {
     foreach (var nativeModule in reactPackage.CreateNativeModules(reactContext))
     {
         nativeRegistryBuilder.Add(nativeModule);
     }
 }
コード例 #7
0
        private void ProcessPackage(
            IReactPackage reactPackage,
            ReactContext reactContext,
            NativeModuleRegistry.Builder nativeRegistryBuilder,
            JavaScriptModuleRegistry.Builder jsModulesBuilder)
        {
            foreach (var nativeModule in reactPackage.CreateNativeModules(reactContext))
            {
                nativeRegistryBuilder.Add(nativeModule);
            }

            foreach (var type in reactPackage.CreateJavaScriptModulesConfig())
            {
                jsModulesBuilder.Add(type);
            }
        }
コード例 #8
0
 public void NativeModuleRegistry_Override_Disallowed()
 {
     var builder = new NativeModuleRegistry.Builder();
     builder.Add(new OverrideDisallowedModule());
     AssertEx.Throws<InvalidOperationException>(() => builder.Add(new OverrideDisallowedModule()));
 }