Ejemplo n.º 1
0
 public void Config(VersionHistoryRegistry registry)
 {
     registry.AddWithAutoKey(VersionHistory.Create(VersionCategory, "1.0.0", new DateTime(2000, 1, 1), "feature 1.0.0"));
     registry.AddWithAutoKey(VersionHistory.Create(VersionCategory, "1.0.1", new DateTime(2000, 1, 2), "bug fix 1.0.1"));
     registry.AddWithAutoKey(VersionHistory.Create(VersionCategory, "1.0.2", new DateTime(2000, 1, 3), "bug fix 1.0.2"));
     registry.AddWithAutoKey(VersionHistory.Create(VersionCategory, "1.1.0", new DateTime(2000, 1, 4), "bug fix 1.1.0"));
 }
Ejemplo n.º 2
0
        public void AddWithAutoKey_SameCategoryAndVersion_Should_ThrowEx()
        {
            var registry = new VersionHistoryRegistry();

            registry.AddWithAutoKey(VersionHistory.Create("Demo", "1.0.0", new DateTime(2000, 1, 1), "feature 1.0.0"));
            registry.AddWithAutoKey(VersionHistory.Create("Demo", "1.0.0", new DateTime(2000, 1, 2), "bug fix 1.0.1"));
        }
Ejemplo n.º 3
0
        public void Init_ArgumentNullOrEmpty_Should_ReturnEmpty()
        {
            var versionHistoryRegistry = new VersionHistoryRegistry();

            versionHistoryRegistry.Init(null);
            versionHistoryRegistry.VersionHistories.Count.ShouldEqual(0);
            versionHistoryRegistry.Init(new List <IVersionHistoryConfig>());
            versionHistoryRegistry.VersionHistories.Count.ShouldEqual(0);
        }
Ejemplo n.º 4
0
        public void AddWithAutoKey_DiffCategoryAndVersion_Should_OK()
        {
            var registry = new VersionHistoryRegistry();

            registry.AddWithAutoKey(VersionHistory.Create("Demo1", "1.0.0", new DateTime(2000, 1, 1), "feature 1.0.0"));
            registry.AddWithAutoKey(VersionHistory.Create("Demo2", "1.0.0", new DateTime(2000, 1, 2), "bug fix 1.0.1"));

            registry.VersionHistories.Count.ShouldEqual(2);
            registry.VersionHistories.Values.LogProperties();
        }
Ejemplo n.º 5
0
        public void Init_NoRepeatConfig_Should_OK()
        {
            var versionHistoryDeclareServices = new List <IVersionHistoryConfig>();

            versionHistoryDeclareServices.Add(new MockAConfig());
            versionHistoryDeclareServices.Add(new MockBConfig());

            var versionHistoryRegistry = new VersionHistoryRegistry();

            versionHistoryRegistry.Init(versionHistoryDeclareServices);

            versionHistoryRegistry.VersionHistories.Count.ShouldEqual(8);
        }
Ejemplo n.º 6
0
        public void Init_Again_Should_Clear()
        {
            var versionHistoryDeclareServices = new List <IVersionHistoryConfig>();

            versionHistoryDeclareServices.Add(new MockAConfig());
            versionHistoryDeclareServices.Add(new MockBConfig());

            var versionHistoryRegistry = new VersionHistoryRegistry();

            versionHistoryRegistry.Init(versionHistoryDeclareServices);
            versionHistoryRegistry.Init(new List <IVersionHistoryConfig>());

            versionHistoryRegistry.VersionHistories.Count.ShouldEqual(0);
        }