Example #1
0
        // public methods
        public static GuidMode CaptureCurrentSettings()
        {
#pragma warning disable 618
            GuidMode settings;
            if (BsonDefaults.GuidRepresentationMode == GuidRepresentationMode.V2)
            {
                settings = new GuidMode(BsonDefaults.GuidRepresentationMode, BsonDefaults.GuidRepresentation);
            }
            else
            {
                settings = new GuidMode(BsonDefaults.GuidRepresentationMode);
            }
            settings._defaultBsonBinaryReaderSettings   = BsonBinaryReaderSettings.Defaults;
            settings._defaultBsonBinaryWriterSettings   = BsonBinaryWriterSettings.Defaults;
            settings._defaultBsonDocumentReaderSettings = BsonDocumentReaderSettings.Defaults;
            settings._defaultBsonDocumentWriterSettings = BsonDocumentWriterSettings.Defaults;
            settings._defaultJsonReaderSettings         = JsonReaderSettings.Defaults;
            settings._defaultJsonWriterSettings         = JsonWriterSettings.Defaults;
            return(settings);

#pragma warning restore 618
        }
Example #2
0
        // public static methods
        public static void Set(GuidRepresentationMode guidRepresentationMode, GuidRepresentation guidRepresentation = GuidRepresentation.Unspecified)
        {
            var mode = new GuidMode(guidRepresentationMode, guidRepresentation);

            mode.Set();
        }
Example #3
0
 public override void Before(MethodInfo methodUnderTest)
 {
     _originalSettings = GuidMode.CaptureCurrentSettings();
     base.Before(methodUnderTest);
 }