Ejemplo n.º 1
0
        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            StringWriter  stringWriter  = new StringWriter(stringBuilder);

            using (BdioWriter bdioWriter = new BdioWriter(stringWriter))
            {
                bdioWriter.WriteBdioNode(BillOfMaterials);
                bdioWriter.WriteBdioNode(Project);
                bdioWriter.WriteBdioNodes(Components);
            }
            return(stringBuilder.ToString());
        }
Ejemplo n.º 2
0
        public void TestOutputStreamOutput()
        {
            MemoryStream memoryStream = new MemoryStream();

            BdioWriter bdioWriter = new BdioWriter(memoryStream);

            bdioWriter.WriteBdioNodes(GetBdioNodes());
            bdioWriter.Dispose();

            string expectedJson = GetExpectedJson();
            string actualJson   = Encoding.UTF8.GetString(memoryStream.ToArray());

            VerifyJsonArraysEqual(expectedJson, actualJson);
        }
Ejemplo n.º 3
0
        public void TestWriterOutput()
        {
            StringBuilder stringBuilder = new StringBuilder();
            TextWriter    writer        = new StringWriter(stringBuilder);
            BdioWriter    bdioWriter    = new BdioWriter(writer);

            bdioWriter.WriteBdioNodes(GetBdioNodes());
            bdioWriter.Dispose();

            string expectedJson = GetExpectedJson();
            string actualJson   = stringBuilder.ToString();

            VerifyJsonArraysEqual(expectedJson, actualJson);
        }