Skip to content

Commit

Permalink
#28: Introduced new Target Frameworks for Synergy.Contracts nuget pac…
Browse files Browse the repository at this point in the history
…kage
  • Loading branch information
MarcinCelej committed Jan 8, 2024
1 parent 3a0eb52 commit a8283a3
Show file tree
Hide file tree
Showing 9 changed files with 700 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# Technical Debt for Synergy.Contracts

Total: 15
Total: 14

## [ContractorRepository.cs](../../../Synergy.Contracts.Samples/ContractorRepository.cs)
- TODO: Marcin Celej [from: Marcin Celej on: 30-04-2023]: Remove this sample project

## [BusinessDocumentation.cs](../../Requirements/BusinessDocumentation.cs)
- TODO: Marcin Celej [from: Marcin Celej on: 08-04-2023]: check that and probably convert docs int tt

## [!Init.cs](../../../Synergy.Contracts/!Init.cs)
- TODO: Marcin Celej [from: Marcin Celej on: 14-05-2023]: Stop supporting netcoreapp2.1;netcoreapp3.1;

## [FailBoolean.cs](../../../Synergy.Contracts/Failures/FailBoolean.cs)
- TODO:mace (from:mace @ 22-10-2016): variable.FailIfFalse(message)
- TODO:mace (from:mace @ 22-10-2016): variable.FailIfTrue(message)
Expand Down
4 changes: 2 additions & 2 deletions Contracts/Synergy.Contracts.Test/Architecture/Public/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public async Task Generate()

// ASSERT
await Verifier.Verify(publicApi, "md")
.UseMethodName("of." + assembly.GetName()
.Name);
.UseMethodName("of." + assembly.GetName().Name)
.UniqueForTargetFrameworkAndVersion();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
# Synergy.Contracts

## DesignByContractViolationException (exception) : Exception, ISerializable
- ctor()
- ctor(
message: string [NotNull, NotNull]
)

## Fail (abstract class)
- Fail.AsOrFail<T>(
value: object [CanBeNull, NoEnumeration],
name: string [CanBeNull, Optional]
) : T? [Extension, CanBeNull, AssertionMethod, ContractAnnotation]
- Fail.Because(
message: string [NotNull, NotNull]
) : DesignByContractViolationException [NotNull, Pure, StringFormatMethod]
- Fail.Because(
message: string [NotNull, NotNull],
args: params Object[] [ParamArray, NotNull, NotNull]
) : DesignByContractViolationException [NotNull, Pure, StringFormatMethod]
- Fail.Because(
message: Violation
) : DesignByContractViolationException [NotNull, Pure]
- Fail.Because<T1, T2, T3>(
message: string [NotNull, NotNull],
arg1: T1?,
arg2: T2?,
arg3: T3?
) : DesignByContractViolationException [NotNull, Pure, StringFormatMethod]
- Fail.Because<T1, T2>(
message: string [NotNull, NotNull],
arg1: T1?,
arg2: T2?
) : DesignByContractViolationException [NotNull, Pure, StringFormatMethod]
- Fail.Because<T1>(
message: string [NotNull, NotNull],
arg1: T1?
) : DesignByContractViolationException [NotNull, Pure, StringFormatMethod]
- Fail.BecauseEnumOutOfRange<T>(
value: T
) : DesignByContractViolationException [NullableContext, NotNull, Pure]
- Fail.CanBeNull<T>(
value: T? [CanBeNull, NoEnumeration]
) : T? [Extension, CanBeNull, AssertionMethod, ContractAnnotation]
- Fail.CastEnumOrFail<T>(
value: Enum [CanBeNull, NoEnumeration],
name: string [NotNull, NotNull]
) : T? [Extension, NotNull]
- Fail.CastOrFail<T>(
value: object [CanBeNull, NoEnumeration],
name: string [CanBeNull, Optional]
) : T? [Extension, NotNull, AssertionMethod, ContractAnnotation]
- Fail.FailIfEmpty(
value: DateTime,
name: string [NotNull, NotNull]
) : DateTime [Extension, AssertionMethod]
- Fail.FailIfEnumOutOfRange<T>(
value: Enum [NotNull, NotNull],
name: string [NotNull, NotNull]
) : T? [Extension, NotNull]
- Fail.FailIfNotDate(
date: DateTime,
name: string
) : DateTime [Extension, AssertionMethod]
- Fail.FailIfNotDate(
date: DateTime? [CanBeNull],
name: string
) : DateTime? [Extension, CanBeNull, AssertionMethod]
- Fail.FailIfNull<T>(
value: T? [CanBeNull, AssertionCondition, NoEnumeration],
message: Violation
) : T? [Extension, NotNull, AssertionMethod, ContractAnnotation]
- Fail.FailIfNull<T>(
value: T? [CanBeNull, AssertionCondition, NoEnumeration],
name: string [NotNull, NotNull]
) : T? [Extension, NotNull, AssertionMethod, ContractAnnotation]
- Fail.IfArgumentEmpty(
argumentValue: string [CanBeNull, AssertionCondition],
argumentName: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfArgumentEmpty(
value: Guid,
argumentName: string [NotNull]
) : void [AssertionMethod]
- Fail.IfArgumentEqual<TExpected, TActual>(
unexpected: TExpected? [CanBeNull],
argumentValue: TActual? [CanBeNull],
argumentName: string [NotNull, NotNull]
) : void [AssertionMethod]
- Fail.IfArgumentNull<T>(
argumentValue: T? [CanBeNull, AssertionCondition, NoEnumeration],
argumentName: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfArgumentWhiteSpace(
argumentValue: string [CanBeNull, AssertionCondition],
argumentName: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfCollectionContains<T>(
collection: IEnumerable<T> [CanBeNull, AssertionCondition],
func: Func<T, bool> [NotNull, NotNull],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfCollectionContainsNull<T>(
collection: IEnumerable<T> [CanBeNull, AssertionCondition],
collectionName: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfCollectionEmpty(
collection: IEnumerable [CanBeNull, AssertionCondition],
collectionName: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfCollectionEmpty(
collection: IEnumerable [CanBeNull, AssertionCondition],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfCollectionsAreNotEquivalent<T>(
collection1: IEnumerable<T> [CanBeNull, AssertionCondition],
collection2: IEnumerable<T> [CanBeNull, AssertionCondition],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfEmpty(
value: DateTime,
name: string [NotNull, NotNull]
) : void [AssertionMethod]
- Fail.IfEmpty(
value: Guid,
message: Violation
) : void [AssertionMethod]
- Fail.IfEmpty(
value: string [CanBeNull, AssertionCondition],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfEmpty(
value: string [CanBeNull, AssertionCondition],
name: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfEnumNotDefined<T>(
value: object [NotNull, NotNull]
) : void
- Fail.IfEnumNotDefined<T>(
value: T
) : void [NullableContext]
- Fail.IfEqual<TExpected, TActual>(
unexpected: TExpected? [CanBeNull],
actual: TActual? [CanBeNull],
message: Violation
) : void [AssertionMethod]
- Fail.IfEqual<TExpected, TActual>(
unexpected: TExpected? [CanBeNull],
actual: TActual? [CanBeNull],
name: string [NotNull, NotNull]
) : void [AssertionMethod]
- Fail.IfFalse(
value: bool [AssertionCondition],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfNotCastable(
value: object [CanBeNull, NoEnumeration],
expectedType: Type [NotNull, NotNull],
message: Violation
) : void [AssertionMethod]
- Fail.IfNotCastable<T>(
value: object [CanBeNull, NoEnumeration],
message: Violation
) : void [AssertionMethod]
- Fail.IfNotDate(
date: DateTime? [CanBeNull],
message: Violation
) : void [AssertionMethod]
- Fail.IfNotDate(
date: DateTime? [CanBeNull],
name: string
) : void [AssertionMethod]
- Fail.IfNotEqual<TExpected, TActual>(
expected: TExpected? [CanBeNull],
actual: TActual? [CanBeNull],
message: Violation
) : void [AssertionMethod]
- Fail.IfNotEqual<TExpected, TActual>(
expected: TExpected? [CanBeNull],
actual: TActual? [CanBeNull],
name: string [NotNull, NotNull]
) : void [AssertionMethod]
- Fail.IfNotNull<T>(
value: T? [CanBeNull, NoEnumeration],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfNotNull<T>(
value: T? [CanBeNull, NoEnumeration],
name: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfNull<T>(
value: T? [CanBeNull, AssertionCondition],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfNull<T>(
value: T? [CanBeNull, AssertionCondition],
name: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfNullOrNotCastable<T>(
value: object [CanBeNull, NoEnumeration]
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfNullOrNotCastable<T>(
value: object [CanBeNull, NoEnumeration],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfTooLong(
value: string [CanBeNull],
maxLength: int,
name: string [NotNull, NotNull]
) : void [AssertionMethod]
- Fail.IfTooLongOrWhitespace(
value: string [CanBeNull],
maxLength: int,
name: string [NotNull, NotNull]
) : void [AssertionMethod]
- Fail.IfTrue(
value: bool [AssertionCondition],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfWhitespace(
value: string [CanBeNull, AssertionCondition],
message: Violation
) : void [AssertionMethod, ContractAnnotation]
- Fail.IfWhitespace(
value: string [CanBeNull, AssertionCondition],
name: string [NotNull, NotNull]
) : void [AssertionMethod, ContractAnnotation]
- Fail.NotNull<T>(
value: T? [CanBeNull, AssertionCondition, NoEnumeration],
name: string [NotNull, NotNull]
) : T? [Extension, NotNull, AssertionMethod, ContractAnnotation]
- Fail.OrFail<T>(
value: T? [CanBeNull, AssertionCondition, NoEnumeration],
name: string [NotNull, NotNull]
) : T? [Extension, NotNull, AssertionMethod, ContractAnnotation]
- Fail.OrFail<T>(
value: T?,
name: string [Nullable, NotNull, NotNull]
) : T [NullableContext, Extension, ContractAnnotation]
- Fail.OrFailIfCollectionEmpty<T>(
collection: T [CanBeNull, AssertionCondition],
collectionName: string [NotNull, NotNull]
) : T [Extension, NotNull, AssertionMethod, ContractAnnotation]
- Fail.OrFailIfCollectionEmpty<T>(
collection: T [CanBeNull, AssertionCondition],
message: Violation
) : T [Extension, NotNull, AssertionMethod, ContractAnnotation]
- Fail.OrFailIfTooLong(
value: string [CanBeNull],
maxLength: int,
name: string [NotNull, NotNull]
) : string [Extension, CanBeNull, AssertionMethod, ContractAnnotation]
- Fail.OrFailIfWhiteSpace(
value: string? [Nullable, AssertionCondition, NoEnumeration],
name: string [NotNull, NotNull]
) : string [Extension, NotNull, AssertionMethod, ContractAnnotation]

## Requirements.Business (abstract class)
- Business.Requires(
condition: bool
) : Business+Requirement [MustUseReturnValue]
- Business.Rule(
description: string
) : Business+Principle [MustUseReturnValue]
- Business.When(
preCondition: bool,
expression: string? [CallerArgumentExpression, Optional]
) : Business+Precondition [NullableContext, MustUseReturnValue]

## Requirements.Business+IPrecondition (interface)
- Met: bool { get; }

## Requirements.Business+Precondition (struct) : Business+IPrecondition
- Comment: string [CanBeNull] { get; }
- Item: Business+Precondition { get; }
- Met: bool { get; }
- ctor(
preCondition: bool,
previous: Business+IPrecondition [CanBeNull, Optional],
comment: string [CanBeNull, Optional]
)
- And(
preCondition: bool
) : Business+Precondition [MustUseReturnValue]
- Requires(
condition: bool
) : Business+Requirement [MustUseReturnValue]
- Requires(
condition: Func<bool>
) : Business+Requirement [MustUseReturnValue]

## Requirements.Business+Principle (struct)
- Description: string { get; }
- ctor(
description: string
)
- Requires(
condition: bool
) : Business+Requirement [MustUseReturnValue]
- Throws(
exception: Exception
) : void
- When(
preCondition: bool
) : Business+Precondition [MustUseReturnValue]

## Requirements.Business+Requirement (struct)
- Comment: string [CanBeNull] { get; }
- Item: Business+Requirement { get; }
- Met: bool { get; }
- ctor(
condition: bool
)
- ctor(
precondition: Business+Precondition?,
condition: bool
)
- ctor(
precondition: Business+Precondition?,
condition: Func<bool>,
comment: string [CanBeNull, Optional]
)
- Throws(
exception: Exception
) : void
- Throws(
message: string
) : void

## Requirements.BusinessRuleViolationException (exception) : Exception, ISerializable
- Requirement: Business+Requirement { get; }
- ctor(
message: string,
requirement: Business+Requirement
)

## Violation (struct)
- ctor(
message: string [NotNull, NotNull],
args: params Object[] [ParamArray, NotNull, NotNull]
)
- Violation.Of(
message: string [NotNull, NotNull],
args: params Object[] [ParamArray, NotNull, NotNull]
) : Violation [StringFormatMethod]

Loading

0 comments on commit a8283a3

Please sign in to comment.