Skip to content

Commit 0243ffd

Browse files
author
José Miguel Sánchez Fernández
authored
Merge pull request #7 from VisualStudioEX3/feature/include-xml-doc-in-builds
Feature/include xml doc in builds
2 parents 915ebc8 + 2b8ab37 commit 0243ffd

31 files changed

+1172
-225
lines changed

.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ file_header_template = unset
2424

2525
# this. and Me. preferences
2626
dotnet_style_qualification_for_event = true:warning
27-
dotnet_style_qualification_for_field = true:warning
27+
dotnet_style_qualification_for_field = true:silent
2828
dotnet_style_qualification_for_method = true:warning
2929
dotnet_style_qualification_for_property = true:warning
3030

@@ -72,7 +72,7 @@ dotnet_remove_unnecessary_suppression_exclusions = none
7272
# var preferences
7373
csharp_style_var_elsewhere = false:error
7474
csharp_style_var_for_built_in_types = false:error
75-
csharp_style_var_when_type_is_apparent = true:warning
75+
csharp_style_var_when_type_is_apparent = true:suggestion
7676

7777
# Expression-bodied members
7878
csharp_style_expression_bodied_accessors = true:silent
@@ -167,7 +167,7 @@ csharp_preserve_single_line_statements = true
167167

168168
# Naming rules
169169

170-
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
170+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
171171
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
172172
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
173173

DIV2.Format.Exporter.Tests/AbstractTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void CleanUp()
3030
if (Directory.Exists(this.ResultFolder))
3131
{
3232
IEnumerable<string> files = Directory.EnumerateFiles(this.ResultFolder, "*.*", SearchOption.AllDirectories);
33-
foreach (var file in files)
33+
foreach (string file in files)
3434
File.Delete(file);
3535
}
3636
}

DIV2.Format.Exporter.Tests/DIV2.Format.Exporter.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20210127-04" />
11-
<PackageReference Include="MSTest.TestAdapter" Version="2.2.0-preview-20210115-03" />
12-
<PackageReference Include="MSTest.TestFramework" Version="2.2.0-preview-20210115-03" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
12+
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

DIV2.Format.Exporter.Tests/Tests/ColorPaletteTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void CreateDefaultInstance()
4141
[TestMethod]
4242
public void CreateInstanceFromBuffer()
4343
{
44-
var buffer = new byte[ColorPalette.SIZE];
44+
byte[] buffer = new byte[ColorPalette.SIZE];
4545

4646
for (int i = 0; i < buffer.Length; i++)
4747
buffer[i] = (byte)this.Random.Next(0, Color.MAX_DAC_VALUE + 1);
@@ -62,7 +62,7 @@ public void FailCreateInstanceFromBuffer()
6262
{
6363
Assert.ThrowsException<ArgumentOutOfRangeException>(() =>
6464
{
65-
var buffer = new byte[ColorPalette.SIZE];
65+
byte[] buffer = new byte[ColorPalette.SIZE];
6666

6767
for (int i = 0; i < buffer.Length; i++)
6868
buffer[i] = byte.MaxValue;
@@ -149,7 +149,7 @@ public void ReadByForEach()
149149
{
150150
int i = 0;
151151
ColorPalette palette = this.CreateTestsPalette();
152-
foreach (var value in palette)
152+
foreach (Color value in palette)
153153
Assert.AreEqual(palette[i++], value);
154154
}
155155

DIV2.Format.Exporter.Tests/Tests/ColorRangeTableTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public void AreEqual()
6363
public void AreNotEqual()
6464
{
6565
var a = new ColorRangeTable();
66-
6766
var b = new ColorRangeTable();
6867
byte startIndex = 64;
6968
for (int i = 0; i < ColorRangeTable.LENGTH; i++)
@@ -117,7 +116,7 @@ public void ReadByForEach()
117116
var b = new ColorRangeTable();
118117
int i = 0;
119118

120-
foreach (var range in b)
119+
foreach (ColorRange range in b)
121120
Assert.AreEqual(a[i++], range);
122121
}
123122

DIV2.Format.Exporter.Tests/Tests/ColorRangeTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void AssertAreEqual(ColorRange a, ColorRange b)
6060
[TestMethod]
6161
public void CreateDefaultInstance()
6262
{
63-
var range = this.CreateDefaultRange(out byte index);
63+
ColorRange range = this.CreateDefaultRange(out byte index);
6464
Assert.AreEqual(ColorRange.LENGTH, index);
6565
this.AssertAreEqualDefaults(range);
6666
}
@@ -75,25 +75,25 @@ public void CreateInstanceFromBuffer()
7575
[TestMethod]
7676
public void AreEqual()
7777
{
78-
var a = this.CreateDefaultRange(out _);
79-
var b = this.CreateDefaultRange(out _);
78+
ColorRange a = this.CreateDefaultRange(out _);
79+
ColorRange b = this.CreateDefaultRange(out _);
8080

8181
Assert.AreEqual(a, b);
8282
}
8383

8484
[TestMethod]
8585
public void AreNotEqual()
8686
{
87-
var a = this.CreateDefaultRange(out _);
88-
var b = this.CreateCustomRange(out _);
87+
ColorRange a = this.CreateDefaultRange(out _);
88+
ColorRange b = this.CreateCustomRange(out _);
8989

9090
Assert.AreNotEqual(a, b);
9191
}
9292

9393
[TestMethod]
9494
public void ReadByIndex()
9595
{
96-
var range = this.CreateDefaultRange(out _);
96+
ColorRange range = this.CreateDefaultRange(out _);
9797
for (byte i = 0; i < ColorRange.LENGTH; i++)
9898
Assert.AreEqual(i, range[i]);
9999
}
@@ -108,7 +108,7 @@ public void FailReadByIndex()
108108
[TestMethod]
109109
public void WriteByIndex()
110110
{
111-
var range = this.CreateDefaultRange(out _);
111+
ColorRange range = this.CreateDefaultRange(out _);
112112

113113
for (byte i = 0, j = 64; i < ColorRange.LENGTH; i++, j++)
114114
range[i] = j;
@@ -128,8 +128,8 @@ public void FailWriteByIndex()
128128
public void ReadByForEach()
129129
{
130130
int i = 0;
131-
var range = this.CreateDefaultRange(out _);
132-
foreach (var value in range)
131+
ColorRange range = this.CreateDefaultRange(out _);
132+
foreach (byte value in range)
133133
Assert.AreEqual(i++, value);
134134
}
135135

@@ -143,7 +143,7 @@ public void Serialize()
143143
[TestMethod]
144144
public void TestCustomValuesFromSerialization()
145145
{
146-
var a = this.CreateCustomRange(out _);
146+
ColorRange a = this.CreateCustomRange(out _);
147147
var b = new ColorRange(a.Serialize());
148148

149149
this.AssertAreEqual(a, b);

DIV2.Format.Exporter.Tests/Tests/ColorTests.cs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public class ColorTests :
1919
const byte GREEN = 128;
2020
const byte BLUE = 255;
2121

22-
readonly byte[] COLOR_VALUES = { RED, GREEN, BLUE };
22+
static readonly byte[] COLOR_VALUES = { RED, GREEN, BLUE };
2323

24-
readonly Color RGB_COLOR = new Color(byte.MaxValue, byte.MaxValue, byte.MaxValue);
25-
readonly Color DAC_COLOR = new Color(Color.MAX_DAC_VALUE, Color.MAX_DAC_VALUE, Color.MAX_DAC_VALUE);
24+
static readonly Color RGB_COLOR = new Color(byte.MaxValue, byte.MaxValue, byte.MaxValue);
25+
static readonly Color DAC_COLOR = new Color(Color.MAX_DAC_VALUE, Color.MAX_DAC_VALUE, Color.MAX_DAC_VALUE);
2626
#endregion
2727

2828
#region Test methods
@@ -97,16 +97,9 @@ public void WriteByIndex()
9797
[TestMethod]
9898
public void FailWriteByIndex()
9999
{
100-
Assert.ThrowsException<IndexOutOfRangeException>(() =>
101-
{
102-
var color = new Color();
103-
color[-1] = 0;
104-
});
105-
Assert.ThrowsException<IndexOutOfRangeException>(() =>
106-
{
107-
var color = new Color();
108-
color[Color.LENGTH + 1] = 0;
109-
});
100+
var color = new Color();
101+
Assert.ThrowsException<IndexOutOfRangeException>(() => color[-1] = 0);
102+
Assert.ThrowsException<IndexOutOfRangeException>(() => color[Color.LENGTH + 1] = 0);
110103
}
111104

112105
[TestMethod]
@@ -153,7 +146,7 @@ public void MinorThan()
153146
{
154147
var a = new Color(0, 128, 255); // 33023
155148
var b = new Color(32, 255, 64); // 2162496
156-
var c = a;
149+
Color c = a;
157150

158151
Assert.IsTrue(a < b);
159152
Assert.IsFalse(b < a);
@@ -167,7 +160,7 @@ public void MajorThan()
167160
{
168161
var a = new Color(32, 255, 64); // 2162496
169162
var b = new Color(0, 128, 255); // 33023
170-
var c = b;
163+
Color c = b;
171164

172165
Assert.IsTrue(a > b);
173166
Assert.IsFalse(b > a);
@@ -179,7 +172,7 @@ public void MajorThan()
179172
[TestMethod]
180173
public void Normalize()
181174
{
182-
var factor = (float)ColorFormat.DAC;
175+
float factor = (float)ColorFormat.DAC;
183176
var color = new Color(8, 32, 63);
184177
var expected = new Vector3(color.red / factor, color.green / factor, color.blue / factor);
185178

DIV2.Format.Exporter.Tests/Tests/ExtensionMethods/ColorExtensionsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public void ToDAC()
1414
{
1515
Color[] rgb = Enumerable.Repeat(new Color(byte.MaxValue, byte.MaxValue, byte.MaxValue), ColorPalette.LENGTH).ToArray();
1616

17-
foreach (var color in rgb)
17+
foreach (Color color in rgb)
1818
Assert.IsFalse(color.IsDAC());
1919

2020
rgb = rgb.ToDAC();
2121

22-
foreach (var color in rgb)
22+
foreach (Color color in rgb)
2323
Assert.IsTrue(color.IsDAC());
2424
}
2525

@@ -38,12 +38,12 @@ public void ToRGB()
3838
{
3939
Color[] dac = Enumerable.Repeat(new Color(Color.MAX_DAC_VALUE, Color.MAX_DAC_VALUE, Color.MAX_DAC_VALUE), ColorPalette.LENGTH).ToArray();
4040

41-
foreach (var color in dac)
41+
foreach (Color color in dac)
4242
Assert.IsTrue(color.IsDAC());
4343

4444
dac = dac.ToRGB();
4545

46-
foreach (var color in dac)
46+
foreach (Color color in dac)
4747
Assert.IsFalse(color.IsDAC());
4848
}
4949

@@ -60,7 +60,7 @@ public void FailToRGB()
6060
[TestMethod]
6161
public void ToColorArray()
6262
{
63-
var buffer = new byte[ColorPalette.SIZE];
63+
byte[] buffer = new byte[ColorPalette.SIZE];
6464

6565
for (int i = 0, j = 0; i < ColorPalette.LENGTH; i++)
6666
for (int k = 0; k < 3; k++)
@@ -76,7 +76,7 @@ public void ToColorArray()
7676
[TestMethod]
7777
public void FailToColorArray()
7878
{
79-
var buffer = new byte[3];
79+
byte[] buffer = new byte[3];
8080
Assert.ThrowsException<ArgumentOutOfRangeException>(() => buffer.ToColorArray());
8181

8282
buffer = new byte[1024];

DIV2.Format.Exporter.Tests/Tests/FPGTests.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void AssertAreEqualDefaultFPG(FPG fpg)
5858
Assert.AreEqual(FPG_TEST_REGISTERS_COUNT, fpg.Count);
5959

6060
for (int i = 0; i < FPG_TEST_REGISTERS_COUNT; i++)
61-
AssertAreEqualDefaultRegisters(fpg, i);
61+
this.AssertAreEqualDefaultRegisters(fpg, i);
6262
}
6363

6464
void AssertAreEqualDefaultRegisters(Register reg, MAP map, string filename)
@@ -82,7 +82,7 @@ void AssertAreEqualDefaultRegisters(FPG fpg, int index)
8282
int GetDefaultFPGSize()
8383
{
8484
int size = ColorPalette.SIZE + ColorRangeTable.SIZE;
85-
foreach (var reg in this._testFPGRegisters)
85+
foreach (Register reg in this._testFPGRegisters)
8686
size += FPG_REGISTER_BASE_SIZE + (ControlPoint.SIZE * reg.controlPoints.Length) + reg.BitmapLength;
8787
return size;
8888
}
@@ -215,7 +215,7 @@ public void ReadByIndex()
215215
{
216216
var fpg = new FPG(this.GetAssetPath(SharedConstants.FILENAME_FPG_TEST));
217217
for (int i = 0; i < FPG_TEST_REGISTERS_COUNT; i++)
218-
AssertAreEqualDefaultRegisters(fpg, i);
218+
this.AssertAreEqualDefaultRegisters(fpg, i);
219219
}
220220

221221
[TestMethod]
@@ -231,9 +231,9 @@ public void ReadByForEach()
231231
{
232232
int i = 0;
233233
var fpg = new FPG(this.GetAssetPath(SharedConstants.FILENAME_FPG_TEST));
234-
foreach (var map in fpg)
234+
foreach (MAP map in fpg)
235235
{
236-
AssertAreEqualDefaultRegisters(this._testFPGRegisters[i], map, fpg.GetFilename(i));
236+
this.AssertAreEqualDefaultRegisters(this._testFPGRegisters[i], map, fpg.GetFilename(i));
237237
i++;
238238
}
239239
}
@@ -259,6 +259,7 @@ public void AddMapWithTheSamePalette()
259259
public void AddMapWithDifferentPalette()
260260
{
261261
const string PLAYER_MAP_FILENAME_FIELD = "PLAYER.MAP";
262+
262263
string playerMapPath = this.GetAssetPath(SharedConstants.FILENAME_IMG_PLAYER_MAP);
263264

264265
var pal = new PAL(this.GetAssetPath(SharedConstants.FILENAME_PAL_DIV));
@@ -325,6 +326,7 @@ public void FailContainsMap()
325326
public void RemoveMapByGraphId()
326327
{
327328
const int GRAPH_ID = 100; // PLAYER.MAP, index 1.
329+
328330
var fpg = new FPG(this.GetAssetPath(SharedConstants.FILENAME_FPG_TEST));
329331

330332
fpg.Remove(GRAPH_ID);
@@ -392,6 +394,7 @@ public void RemoveMapByIndex()
392394
{
393395
const int GRAPH_ID = 100; // PLAYER.MAP, index 1.
394396
const int INDEX = 1;
397+
395398
var fpg = new FPG(this.GetAssetPath(SharedConstants.FILENAME_FPG_TEST));
396399

397400
fpg.RemoveAt(INDEX);
@@ -403,6 +406,7 @@ public void RemoveMapByIndex()
403406
public void FailRemoveMapByIndex()
404407
{
405408
var fpg = new FPG(this.GetAssetPath(SharedConstants.FILENAME_FPG_TEST));
409+
406410
Assert.ThrowsException<IndexOutOfRangeException>(() => fpg.RemoveAt(-1));
407411
Assert.ThrowsException<IndexOutOfRangeException>(() => fpg.RemoveAt(fpg.Count + 1));
408412
}
@@ -412,6 +416,7 @@ public void FailRemoveMapByIndexWhenFPGIsEmpty()
412416
{
413417
var pal = new PAL(this.GetAssetPath(SharedConstants.FILENAME_PAL_SPACE));
414418
var fpg = new FPG(pal);
419+
415420
Assert.ThrowsException<InvalidOperationException>(() => fpg.Remove(0));
416421
}
417422

0 commit comments

Comments
 (0)