public void TestSerialize2() { var template = new AnalyserTemplate { Configuration = new TestConfiguration() }; // We don't pass the type of the expected sub-types so the configuration // cannot be restored. This can happen when opening a template / snapshot // on an older installation or one that doesn't have a particular plugin. var actualTemplate = template.Roundtrip(); actualTemplate.Should().NotBeNull(); actualTemplate.Configuration.Should().BeNull(); }
public void TestSerialize1() { var template = new AnalyserTemplate { Id = AnalyserId.CreateNew(), AnalyserPluginId = new AnalyserPluginId("lkwdqjklowlkw"), Configuration = new TestConfiguration() }; var actualTemplate = template.Roundtrip(typeof(TestConfiguration)); actualTemplate.Should().NotBeNull(); actualTemplate.Id.Should().Be(template.Id); actualTemplate.AnalyserPluginId.Should().Be(template.AnalyserPluginId); actualTemplate.Configuration.Should().NotBeNull(); actualTemplate.Configuration.Should().BeOfType <TestConfiguration>(); }