Esempio n. 1
0
        public void AReadDTOAndWritePBAllConcepts()
        {
            DateTime   start  = DateTime.Now;
            FileStream output = File.Create(ProtobufFile);

            using PBWriter pbWriter = new PBWriter(output);
            NativeMethods.PreventSleep();
            Int32 i = 0;

            foreach (IComponent component in this.ReadConcepts())
            {
                PBTinkarMsg pb = ConvertDTOToPB.Convert(component);
                pbWriter.Write(pb);
                i += 1;
            }
            NativeMethods.AllowSleep();
            TimeSpan elapsed = DateTime.Now - start;

            Trace.WriteLine($"AConvertAndWriteAllConcepts time {elapsed}");
        }
Esempio n. 2
0
        public void AConvertAndVerifyAllConcepts()
        {
            NativeMethods.PreventSleep();
            DateTime start = DateTime.Now;
            Int32    i     = 0;

            foreach (IComponent component in this.ReadConcepts())
            {
                PBTinkarMsg pb = ConvertDTOToPB.Convert(component);
                if (pb != null)
                {
                    IComponent dto = ConvertPBToDTO.Convert(pb);
                    Assert.True(component.CompareTo(dto) == 0);
                }
                i += 1;
            }
            NativeMethods.AllowSleep();
            TimeSpan elapsed = DateTime.Now - start;

            Trace.WriteLine($"AConvertAndVerifyAllConcepts time {elapsed}");
        }