コード例 #1
0
        public void Ctor_ShouldInstantiateCalculatorGraph_When_CalledWithConfigText()
        {
            var graph  = new CalculatorGraph(validConfigText);
            var config = graph.Config();

            Assert.AreEqual(config.InputStream[0], "in");
            Assert.AreEqual(config.OutputStream[0], "out");
        }
コード例 #2
0
 public void Ctor_ShouldInstantiateCalculatorGraph_When_CalledWithConfigText()
 {
     using (var graph = new CalculatorGraph(_ValidConfigText))
     {
         var config = graph.Config();
         Assert.AreEqual("in", config.InputStream[0]);
         Assert.AreEqual("out", config.OutputStream[0]);
     }
 }
コード例 #3
0
        public void Initialize_ShouldReturnOk_When_CalledWithConfig_And_ConfigIsNotSet()
        {
            var graph  = new CalculatorGraph();
            var status = graph.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(validConfigText));

            Assert.True(status.ok);

            var config = graph.Config();

            Assert.AreEqual(config.InputStream[0], "in");
            Assert.AreEqual(config.OutputStream[0], "out");
        }
コード例 #4
0
        public void Initialize_ShouldReturnOk_When_CalledWithConfig_And_ConfigIsNotSet()
        {
            using (var graph = new CalculatorGraph())
            {
                using (var status = graph.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText)))
                {
                    Assert.True(status.Ok());
                }

                var config = graph.Config();
                Assert.AreEqual("in", config.InputStream[0]);
                Assert.AreEqual("out", config.OutputStream[0]);
            }
        }