public void Serialize_Handles_Strings()
        {
            // Arrange
            var type = ScalarClasses.ClassWithBarStringProperty();

            // Act
            var result = _classUnderTest.Serialize(type);

            // Assert
            var expectedJson = @"{
  ""Bar"": ""BarFooString1""
}";

            Assert.AreEqual(expectedJson, result);
        }
        public bool Handle(IClassInfoSerializer serializer, ClassInfo classInfo)
        {
            string memberInfoString = PrintMemberInfoRercursive(classInfo, 0);
            string json             = serializer.Serialize(classInfo);
            string output           = memberInfoString + Environment.NewLine + Environment.NewLine + json;

            return(SerializeThisCommand.ShowMessageBox(_serviceProvider, output));
        }
        private bool TryWriteTempFile(string filename, IClassInfoSerializer serializer, ClassInfo classInfo)
        {
            string serialized = serializer.Serialize(classInfo);

            File.WriteAllText(filename, serialized);

            return(true);
        }
Esempio n. 4
0
        private bool TryWriteTempFile(IClassInfoSerializer serializer, ClassInfo classInfo, out string filename)
        {
            filename = GenerateUniqueFileName(serializer, classInfo);

            string serialized = serializer.Serialize(classInfo);

            File.WriteAllText(filename, serialized);

            return(true);
        }
 public void UpdateModel(IClassInfoSerializer serializer, ClassInfo classInfo)
 {
     this.serializedModelTextBox.Text = serializer.Serialize(classInfo);
 }