<ProgramFilesX64>\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\plugins\Diagnostics\Newtonsoft.Json.dll
Amazon.Lambda.S3Events
AWSSDK.Core
AWSSDK.S3
FluentAssertions
Amazon
Amazon.Auth.AccessControlPolicy
Amazon.Auth.AccessControlPolicy.ActionIdentifiers
Amazon.Internal
Amazon.Lambda.S3Events
Amazon.MissingTypes
Amazon.Runtime
Amazon.Runtime.CredentialManagement
Amazon.Runtime.CredentialManagement.Internal
Amazon.Runtime.EventStreams
Amazon.Runtime.EventStreams.Internal
Amazon.Runtime.Internal
Amazon.Runtime.Internal.Auth
Amazon.Runtime.Internal.Settings
Amazon.Runtime.Internal.Transform
Amazon.Runtime.Internal.Util
Amazon.Runtime.SharedInterfaces
Amazon.Runtime.SharedInterfaces.Internal
Amazon.S3
Amazon.S3.Encryption
Amazon.S3.Encryption.Internal
Amazon.S3.Internal
Amazon.S3.IO
Amazon.S3.Model
Amazon.S3.Model.Internal.MarshallTransformations
Amazon.S3.Transfer
Amazon.S3.Util
Amazon.Util
Amazon.Util.Internal
Amazon.Util.Internal.PlatformServices
Newtonsoft.Json
Newtonsoft.Json.Converters
Newtonsoft.Json.Linq
Newtonsoft.Json.Schema
Newtonsoft.Json.Serialization
System
System.Diagnostics
System.Diagnostics.Tracing
System.IO.Compression
ThirdParty.BouncyCastle.Asn1
ThirdParty.BouncyCastle.Asn1.Utilities
ThirdParty.BouncyCastle.Math
ThirdParty.BouncyCastle.OpenSsl
ThirdParty.BouncyCastle.Utilities.IO.Pem
ThirdParty.Ionic.Zlib
ThirdParty.Json.LitJson
ThirdParty.MD5
FluentAssertions.Equivalency
FluentAssertions.Execution
FluentAssertions
void Main()
{
var lt = LoginType.Something;
Action act1 = () =>
{
var ltDto = LoginTypeDto.Something;
ltDto.Should().BeEquivalentTo(lt, options => options.Using(new LoginTypeRule()));
};
Action act2 = () =>
{
var ltDto = LoginTypeDto.SomethingElse;
ltDto.Should().BeEquivalentTo(lt, options => options.Using(new LoginTypeRule()));
};
act1.Should().NotThrow();
act2.Should().Throw();
}
// Define other methods and classes here
public class LoginTypeRule : IAssertionRule
{
public bool AssertEquality(IEquivalencyValidationContext context)
{
var subjectValue = GetValueForEnum(context.Subject);
var expectationValue = GetValueForEnum(context.Expectation);
if (subjectValue == null || expectationValue == null)
{
// rule not applicable
return false;
}
Execute.Assertion
.BecauseOf(context.Because, context.BecauseArgs)
.ForCondition(subjectValue == expectationValue)
.FailWith("Expected {context:string} to be {0}{reason}, but found {1}",
context.Subject, context.Expectation);
// equality assertion handled
return true;
}
private int? GetValueForEnum(object enumValue)
{
if (enumValue is LoginType || enumValue is LoginTypeDto)
{
return (int)enumValue;
}
return null;
}
}
enum LoginType { Something, SomethingElse, Other };
enum LoginTypeDto { Something, SomethingElse, Other }