-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tooling): use AppContext to set EnableUnsafeBinaryFormatterSerial…
…ization (#1349)
- Loading branch information
Showing
5 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2023 Maintainers of NUKE. | ||
// Distributed under the MIT License. | ||
// https://github.com/nuke-build/nuke/blob/master/LICENSE | ||
|
||
using FluentAssertions; | ||
using Nuke.Common.Tooling; | ||
using System; | ||
using Xunit; | ||
|
||
namespace Nuke.Common.Tests; | ||
|
||
public class NewInstanceTest | ||
{ | ||
[Serializable] | ||
public class SimpleEntity : ISettingsEntity | ||
{ | ||
public int Integer { get; set; } | ||
public string String { get; set; } | ||
} | ||
|
||
[Fact] | ||
public void TestSimpleEntity() | ||
{ | ||
var entity = new SimpleEntity { Integer = 1, String = "test" }; | ||
var newInstance = entity.NewInstance(); | ||
|
||
newInstance.Integer.Should().Be(entity.Integer); | ||
newInstance.String.Should().Be(entity.String); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters