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"); }
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]); } }
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"); }
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]); } }