Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.Tests/HeuristicLab.Persistence.Attic/StorableAttributeTests.cs @ 16997

Last change on this file since 16997 was 16559, checked in by jkarder, 5 years ago

#2520: renamed Fossil to Attic and set version to 1.0.0-pre01

File size: 2.5 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HEAL.Attic;
23
24namespace HeuristicLab.Persistence.Attic.Tests {
25
26  [StorableType("E0862640-FD57-4F1B-929D-03E38D8EA5D3")]
27  class DemoClass {
28
29    [Storable(Name = "TestProperty", DefaultValue = 12)]
30    public object o = null;
31
32    [Storable]
33    public int x = 2;
34
35    public int y = 0;
36
37    [StorableConstructor]
38    protected DemoClass(StorableConstructorFlag _) {
39    }
40    public DemoClass() {
41    }
42  }
43
44  [StorableType("7C5431ED-9754-44B9-870D-F62E822A74CE")]
45  class Base {
46    public string baseName;
47    [Storable]
48    public virtual string Name {
49      get { return "Base"; }
50      set { baseName = value; }
51    }
52
53    [StorableConstructor]
54    protected Base(StorableConstructorFlag _) {
55    }
56    public Base() {
57    }
58  }
59
60  [StorableType("39BC0BDD-C5F4-4FAA-B227-558909E7AE6C")]
61  class Override : Base {
62    [Storable]
63    public override string Name {
64      get { return "Override"; }
65      set { base.Name = value; }
66    }
67
68    [StorableConstructor]
69    protected Override(StorableConstructorFlag _) : base(_) {
70    }
71    public Override() {
72    }
73  }
74
75  [StorableType("50E13067-A343-4059-B44B-54511ED813AE")]
76  class Intermediate : Override {
77    [StorableConstructor]
78    protected Intermediate(StorableConstructorFlag _) : base(_) {
79    }
80    public Intermediate() {
81    }
82  }
83
84  [StorableType("DA7868B2-81CC-48AC-AEC3-2E3AD2E0A34E")]
85  class New : Intermediate {
86    public string newName;
87    [Storable]
88    public new string Name {
89      get { return "New"; }
90      set { newName = value; }
91    }
92
93    [StorableConstructor]
94    protected New(StorableConstructorFlag _) : base(_) {
95    }
96    public New() {
97    }
98  }
99}
Note: See TracBrowser for help on using the repository browser.