public void ConvertAGlimpseMetadataObject()
        {
            var metadata = new GlimpseMetadata();

            var converter = new GlimpseMetadataConverter();

            var obj = converter.Convert(metadata);

            var result = obj as IDictionary <string, object>;

            Assert.NotNull(result);
            Assert.True(result.ContainsKey("version"));
            Assert.True(result.ContainsKey("plugins"));
            Assert.True(result.ContainsKey("resources"));
        }
示例#2
0
        public void ReturnResourceResult()
        {
            var metadata = new GlimpseMetadata();

            var storeMock = new Mock <IReadOnlyPersistenceStore>();

            storeMock.Setup(s => s.GetMetadata()).Returns(metadata);

            var contextMock = new Mock <IResourceContext>();

            contextMock.Setup(c => c.PersistenceStore).Returns(storeMock.Object);
            contextMock.Setup(c => c.Parameters[ResourceParameter.Callback.Name]).Returns("a string");

            var resource = new MetadataResource();

            var result = resource.Execute(contextMock.Object);

            Assert.NotNull(result);
        }
 public virtual void Save(GlimpseMetadata metadata)
 {
     Interlocked.Exchange(ref _metadata, metadata);
 }