Ejemplo n.º 1
0
        public void TestLoadFromConfigJsonFileNotExists()
        {
            // Should not be able to instantiate a new instance of "Client" without an actual configuration file


            NetworkConfig.FromJsonFile("FileDoesNotExist.json");
        }
Ejemplo n.º 2
0
        public void TestLoadFromConfigFileJsonBasic()
        {
            string        f      = TestUtils.TestUtils.RelocateFilePathsJSON("fixture/sdkintegration/network_configs/network-config.json".Locate());
            NetworkConfig config = NetworkConfig.FromJsonFile(f);

            Assert.IsNotNull(config);
        }
Ejemplo n.º 3
0
        public void TestLoadFromConfigFileJson()
        {
            // Should be able to instantiate a new instance of "Client" with a valid path to the JSON configuration
            string        f      = TestUtils.TestUtils.RelocateFilePathsJSON("fixture/sdkintegration/network_configs/network-config.json".Locate());
            NetworkConfig config = NetworkConfig.FromJsonFile(f);

            Assert.IsNotNull(config);

            //HFClient client = HFClient.loadFromConfig(f);
            //Assert.Assert.IsNotNull(client);

            HFClient client = HFClient.Create();

            client.CryptoSuite = Factory.Instance.GetCryptoSuite();
            client.UserContext = TestUtils.TestUtils.GetMockUser(USER_NAME, USER_MSP_ID);

            Channel channel = client.LoadChannelFromConfig("mychannel", config);

            Assert.IsNotNull(channel);
        }
Ejemplo n.º 4
0
        public void TestLoadFromConfigNullJsonFile()
        {
            // Should not be able to instantiate a new instance of "Client" without a valid path to the configuration');

            NetworkConfig.FromJsonFile(null);
        }