예제 #1
0
 string escapeString(NonNull <string> str) => escapeString(str.Item);
예제 #2
0
 public static string IdentifierForTypeOrNull <T>(this NonNull <string> id) =>
 id.IsIdentifierForType <T>() ? id.IdentifierForType <T>() : null;
예제 #3
0
 public void Given_argument_is_OrExpression_Constructor_should_wrap_it_inside_a_GroupExpression(NonNull <OrExpression> expression)
 => Given_argument_needs_wrapping_Constructor_should_wrap_it_inside_a_GroupExpression(expression.Item);
예제 #4
0
 public FooOutput Mutate(NonNull <FooInput> input) =>
 new FooOutput
 {
     Result = 2 * input.Value.A
 };
예제 #5
0
 public Property Given_NotExpression_GetComplexity_should_return_same_complexity_as_embedded_expression(NonNull <NotExpression> notExpression)
 => (notExpression.Item.Complexity == notExpression.Item.Expression.Complexity).ToProperty();
예제 #6
0
 public Property Given_NotExpression_and_a_filter_expression_that_is_not_null_Equals_should_be_symetric(NonNull <NotExpression> notExpression, NonNull <FilterExpression> filterExpression)
 => (notExpression.Item.Equals(filterExpression.Item) == filterExpression.Item.Equals(notExpression.Item)).ToProperty();
예제 #7
0
        public async Task <MutationInfo> UpdateContactInfo([Inject] IMediator mediator, [Inject] IRequestInfo requestInfo, NonNull <UpdateSupplierContactInfoParameters> parameters)
        {
            var command = new UpdateSupplierContactInfoCommand
            {
                Id          = parameters.Value.Id,
                ContactInfo = parameters.Value.ContactInfo,
                Headers     = new CommandHeaders(correlationId: Guid.NewGuid(), identity: requestInfo.Identity, remoteIpAddress: requestInfo.IpAddress)
            };

            var result = await mediator.Send(command);

            return(MutationInfo.FromCommand(command));
        }
예제 #8
0
 public Property Equals_should_be_reflexive(NonNull <NotExpression> expression)
 => expression.Item.Equals(expression.Item).ToProperty();
예제 #9
0
 public string ComplexInputObjectField(NonNull <ComplexInputObject> arg) =>
 $"{arg.Value.Identifier}-{arg.Value.NullableObjects.First().Field1}-" +
 $"{arg.Value.NonNullableObjects.Last().Value.Field3}-{arg.Value.ListOfEnums.Value.First()}";
예제 #10
0
        public async Task <MutationInfo> Add([Inject] IMediator mediator, [Inject] IRequestInfo requestInfo, NonNull <AddFinancialYearParameters> parameters)
        {
            var command = new AddFinancialYearCommand
            {
                Id   = Guid.NewGuid(),
                Name = parameters.Value.Name,
                PreviousFinancialYearId = parameters.Value.PreviousFinancialYearId,
                Headers = new CommandHeaders(correlationId: Guid.NewGuid(), identity: requestInfo.Identity, remoteIpAddress: requestInfo.IpAddress)
            };

            var result = await mediator.Send(command);

            return(MutationInfo.FromCommand(command));
        }
예제 #11
0
 public string NonNullableInputObjectField(NonNull <InputObject> arg) =>
 arg.Value.ToString();
예제 #12
0
 public NonNull <string> NonNullablePrimitiveField(NonNull <string> nonNullablePrimitiveArg) =>
 nonNullablePrimitiveArg;
            public async Task <NonNull <DoSomethingOutput> > TaskDoSomething(NonNull <DoSomethingInput> input)
            {
                await Task.Delay(1);

                return(DoSomething(input));
            }
예제 #14
0
 public DeleteOperation(NonNull<string> username)
 {
     UserName = username;
 }
예제 #15
0
        public async Task <MutationInfo> AddTransfer([Inject] IMediator mediator, [Inject] IRequestInfo requestInfo, NonNull <AddTransferTransactionParameters> parameters)
        {
            var command = new AddTransferTransactionCommand
            {
                IdOrigin             = Guid.NewGuid(),
                IdDestination        = Guid.NewGuid(),
                FinancialYearId      = parameters.Value.FinancialYearId,
                OriginAccountId      = parameters.Value.OriginAccountId,
                DestinationAccountId = parameters.Value.DestinationAccountId,
                AmountInCents        = parameters.Value.AmountInCents,
                Description          = parameters.Value.Description,
                Comment   = parameters.Value.Comment,
                CodeNames = parameters.Value.CodeNames,
                Headers   = new CommandHeaders(correlationId: Guid.NewGuid(), identity: requestInfo.Identity, remoteIpAddress: requestInfo.IpAddress)
            };

            var result = await mediator.Send(command);

            return(MutationInfo.FromCommand(command));
        }
 public NonNull <DoSomethingOutput> NonNullableDoSomething(NonNull <DoSomethingInput> input) =>
 DoSomething(input);
예제 #17
0
        public async Task <MutationInfo> UnassignCode([Inject] IMediator mediator, [Inject] IRequestInfo requestInfo, NonNull <UnassignCodeFromTransactionParameters> parameters)
        {
            var command = new UnassignCodeFromTransactionCommand
            {
                Id       = parameters.Value.Id,
                CodeName = parameters.Value.CodeName,
                Headers  = new CommandHeaders(correlationId: Guid.NewGuid(), identity: requestInfo.Identity, remoteIpAddress: requestInfo.IpAddress)
            };

            var result = await mediator.Send(command);

            return(MutationInfo.FromCommand(command));
        }
예제 #18
0
 public Property Equals_should_be_symetric(NonNull <NotExpression> expression, NonNull <FilterExpression> otherExpression)
 => (expression.Item.Equals(otherExpression.Item) == otherExpression.Item.Equals(expression.Item)).ToProperty();
예제 #19
0
        public async Task <MutationInfo> Remove([Inject] IMediator mediator, [Inject] IRequestInfo requestInfo, NonNull <RemoveAccountParameters> parameters)
        {
            var command = new RemoveAccountCommand
            {
                Id      = parameters.Value.Id,
                Headers = new CommandHeaders(correlationId: Guid.NewGuid(), identity: requestInfo.Identity, remoteIpAddress: requestInfo.IpAddress)
            };

            var result = await mediator.Send(command);

            return(MutationInfo.FromCommand(command));
        }
예제 #20
0
 public Property Given_NotExpression_Equals_should_be_reflexive(NonNull <NotExpression> notExpression)
 => notExpression.Item.Equals(notExpression.Item).ToProperty();
        public void Given_TextExpression_as_input_EscapedParseableString_should_be_correct(NonNull <TextExpression> text)
        {
            // Arrange
            StartsWithExpression expression = new(text.Item);
            string expected = $"{text.Item.EscapedParseableString}*";

            // Act
            string actual = expression.EscapedParseableString;

            // Assert
            actual.Should()
            .Be(expected);
        }
예제 #22
0
        public Property Given_two_instances_holding_same_Expressions_Equals_should_return_true(NonNull <FilterExpression> expression)
        {
            // Arrange
            NotExpression first = new(expression.Item);
            NotExpression other = new(expression.Item);

            // Act
            return(first.Equals(other)
                   .And(first.GetHashCode() == other.GetHashCode()));
        }
        public void GivenANonNull_ShouldReturnTrue(NonNull <object> nonNullObject)
        {
            var @object = nonNullObject.Item;

            @object.IsNotNull().Should().BeTrue();
        }
예제 #24
0
 public BarOutput Mutate(NonNull <BarInput> input) =>
 new BarOutput
 {
     Result = 100 + input.Value.B
 };
 public bool Const_Function_Holds(NonNull <string> x, int y) => x.Get.Const <int, string>()(y) == Id <string>()(x.Get);
 public List <SearchResult> Search(NonNull <string> searchFor) =>
 new List <SearchResult>
 {
     new SearchResult(0.97, new Movie()),
 };
 public bool Curry_Same_As_Apply(byte x, int y, NonNull <string> z, Func <byte, int, string, int> f) =>
 f.Curry()(x)(y)(z.Get) == f.Apply(x).Apply(y).Apply(z.Get);
예제 #28
0
 public OmdbResolver(WebClient webClient, NonNull <string> omdbApiKey)
 {
     WebClient = webClient;
     apiKey    = omdbApiKey;
 }
        public Property Null_Check_If_Null_Then(string x, NonNull <string> y)
        {
            string sut = x.IfNullThen(y.Get);

            return((x == null && sut == y.Get).ToProperty().Or(x != null && sut == x));
        }
예제 #30
0
 public static bool IsIdentifierForType <T>(this NonNull <string> id) =>
 id.Value.IsIdentifierForType <T>();
예제 #31
0
 public Property Equals_should_be_commutative(NonNull <NotExpression> first, FilterExpression second)
 => (first.Item.Equals(second) == second.Equals(first.Item)).ToProperty();
예제 #32
0
 public GetOperation(NonNull<string> userName)
 {
     UserName = userName;
 }
예제 #33
0
 public static void ReadGames(NonNull<string> filepath)
 {
 }