Skip to content

Commit

Permalink
Next Step
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergHoffmannatGitHub committed Feb 6, 2024
1 parent a100d77 commit f1bcac8
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion FamilyShowLib.Tests/PeopleTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
namespace FamilyShowLib.Tests;
using System.Xml.Serialization;

namespace FamilyShowLib.Tests;

// These tests will run infinite on GitHub
public class PeopleTest
{
[Fact]
public void StepByStep()
{
PeopleCollection PeopleCollection = [];

string FullyQualifiedFilename = Sample.FullName("Windsor.familyx");
Assert.NotNull(FullyQualifiedFilename);
Assert.NotNull(App.ApplicationFolderName);
Expand All @@ -18,6 +22,21 @@ public void StepByStep()
OPCUtility.ExtractPackage(FullyQualifiedFilename, tempFolder, true);
DirectoryInfo directoryInfo = new(tempFolder);
Assert.True(directoryInfo.Exists);

XmlSerializer xml = new(typeof(People));

using(FileStream stream = new(tempFolder + "content.xml", FileMode.Open, FileAccess.Read, FileShare.Read))
{
People pc = (People)xml.Deserialize(stream);

Check warning on line 30 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Converting null literal or possible null value to non-nullable type. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]

Check warning on line 30 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Converting null literal or possible null value to non-nullable type. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]

Check warning on line 30 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Converting null literal or possible null value to non-nullable type. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]

Check warning on line 30 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Converting null literal or possible null value to non-nullable type. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]
stream.Close();

foreach (Person person in pc.PeopleCollection)

Check warning on line 33 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Dereference of a possibly null reference. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]

Check warning on line 33 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Dereference of a possibly null reference. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]

Check warning on line 33 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]

Check warning on line 33 in FamilyShowLib.Tests/PeopleTest.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Dereference of a possibly null reference. [D:\a\Family.Show\Family.Show\FamilyShowLib.Tests\FamilyShowLib.Tests.csproj]
{
PeopleCollection.Add(person);
}
}

Assert.Equal(81, PeopleCollection.Count);
}

[Fact]
Expand Down

0 comments on commit f1bcac8

Please sign in to comment.