public static TestViewModelForSerialization Create()
        {
            _viewModelForSerializationForBag = new TestViewModelForSerialization()
            {
                TestInt      = GetRandom.Int(),
                TestString   = GetRandom.String(GetRandom.Int(3, 1200)),
                TestGuid     = GetRandom.Guid(),
                TestDouble   = GetRandom.Double(),
                TestDateTime = GetRandom.DateTime()
            };

            _bag = new Dictionary <string, object>
            {
                { "TestObjectInTheBag", _viewModelForSerializationForBag },
                { "TestStringInTheBag", GetRandom.String(GetRandom.Int(3, 1200)) },
                { "TestIntInTheBag", GetRandom.Int(int.MinValue, int.MaxValue) },
                { "TestDateInTheBag", GetRandom.DateTime() },
                { "TestDecimalInTheBag", (decimal)GetRandom.Double() },
                { "TestGuidInTheBag", GetRandom.Guid() },
            };

            _nestedViewModelForSerialization = new TestViewModelForSerialization()
            {
                TestInt      = GetRandom.Int(),
                TestString   = GetRandom.String(GetRandom.Int(3, 1200)),
                TestGuid     = GetRandom.Guid(),
                TestBag      = _bag,
                TestDouble   = GetRandom.Double(),
                TestDateTime = GetRandom.DateTime()
            };
            _testViewModelForSerialization = new TestViewModelForSerialization()
            {
                TestInt      = GetRandom.Int(),
                TestString   = GetRandom.String(GetRandom.Int(3, 1200)),
                TestGuid     = GetRandom.Guid(),
                TestBag      = _bag,
                TestNested   = _nestedViewModelForSerialization,
                TestDouble   = GetRandom.Double(),
                TestDateTime = GetRandom.DateTime()
            };
            return(_testViewModelForSerialization);
        }
        protected void Setup()
        {
            MetadataRegistry = Container.GetMock <IViewModelMetadataRegistry>();
            ViewModelMetadataRegistry.Current = MetadataRegistry.Object;
            ViewModelForSerialization         = TestViewModelForSerializationFactory.Create();

            var sourceType = ViewModelForSerialization.GetType();

            _metadata = new List <IPropertyMetadata>();

            foreach (var propertyInfo in sourceType.GetProperties())
            {
                _metadata.Add(new InstancePropertyMetadata(propertyInfo));
            }
            Dependency <IViewModelMetadataRegistry>().Setup(m => m.GetViewModelMetadata(typeof(TestViewModelForSerialization))).Returns(_metadata);

            var lookupService            = Container.GetMock <ILookupService>();
            var localizationProviderMock = Container.GetMock <ILocalizationProvider>();

            ViewModelMapper = new Composer.ViewModels.ViewModelMapper(MetadataRegistry.Object, Dependency <IViewModelPropertyFormatter>().Object, lookupService.Object, localizationProviderMock.Object);

            JsonFromStandardSerializer = JsonConvert.SerializeObject(ViewModelForSerialization, Formatting.Indented);
        }