Ejemplo n.º 1
0
        private SingletonShapes()
        {
            ShapeDto m_NewShapes = JsonConvert.DeserializeObject <ShapeDto>(File.ReadAllText(Path.Combine(Environment.CurrentDirectory, TestConstants.SHAPES_FILE_01_PATH)));

            m_Shapes.AddRange(m_NewShapes.Hexagons);
            m_Shapes.AddRange(m_NewShapes.Stars);
            m_Shapes.AddRange(m_NewShapes.Circles);
        }
Ejemplo n.º 2
0
        public void CanSerializeJson_True()
        {
            var got = new ShapeDto()
            {
                Hexagons = SampleShapes.Hexagons.Cast <Hexagon>().ToList(),
                Circles  = SampleShapes.Circles.Cast <Circle>().ToList(),
                Stars    = SampleShapes.Stars.Cast <Star>().ToList()
            };

            File.WriteAllText(Path.Combine(Environment.CurrentDirectory, TestConstants.SHAPES_FILE_01_PATH), JsonConvert.SerializeObject(got));
            Assert.True(true);
        }
Ejemplo n.º 3
0
        public void CanDeserializeJson_True()
        {
            ShapeDto m_NewShapes = JsonConvert.DeserializeObject <ShapeDto>(File.ReadAllText(Path.Combine(Environment.CurrentDirectory, TestConstants.SHAPES_FILE_01_PATH)));

            Assert.True(true);
        }