Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Various Tests to Assist with Question(s) #569

Merged
merged 4 commits into from
Nov 25, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Confirmed serializing/deserializing with 2000 sample elements
  • Loading branch information
Mike-E-angelo committed Nov 15, 2021
commit a27ec5abb4387650d309c6dfe0a2a703f9681305
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using ExtendedXmlSerializer.Configuration;
using ExtendedXmlSerializer.Tests.ReportedIssues.Support;
using FluentAssertions;
using System;
using System.Collections.Generic;
using Xunit;

namespace ExtendedXmlSerializer.Tests.ReportedIssues
{
public sealed class Issue565Tests_Extended_II
{
[Fact]
public void Verify()
{
List<TestSerialization> instance = new List<TestSerialization>();
for (int i = 0; i < 2000; i++)
{
var newElement = new TestSerialization();
if (i % 2 == 0)
{
newElement.MyString = "**********";
newElement.MyDouble = Double.MaxValue;
newElement.MyBool = true;
newElement.MyInteger = i;
}
else
{
newElement.MyString = "----------";
newElement.MyDouble = Double.MinValue;
newElement.MyBool = false;
newElement.MyInteger = i;
}
instance.Add(newElement);
}

var serializer = new ConfigurationContainer().EnableImplicitTyping(typeof(List<TestSerialization>))
.Create();

serializer.Cycle(instance).Should().BeEquivalentTo(instance);



}

[Serializable]
public class TestSerialization
{
public string MyString { get; set; }

public bool MyBool { get; set; }

public double MyDouble { get; set; }

public int MyInteger { get; set; }
}
}
}