Exemplo n.º 1
0
        public async Task All_input_validations_for_initiate_change_of_supplier_should_fail_for_empty_object()
        {
            var ruleCollectionTester     = RuleCollectionTester.Create <InitiateChangeOfSupplierRules, RequestChangeOfSupplier>();
            var initiateChangeOfSupplier = new RequestChangeOfSupplier();

            var result = await ruleCollectionTester.InvokeAsync(initiateChangeOfSupplier).ConfigureAwait(false);

            result.Count.Should().Be(5);
        }
Exemplo n.º 2
0
        public async Task Consumer_should_fail_if_containing_invalid_or_missing_qualifier(MarketParticipant marketParticipant)
        {
            var ruleCollectionTester     = RuleCollectionTester.Create <InitiateChangeOfSupplierRules, RequestChangeOfSupplier>();
            var initiateChangeOfSupplier = new RequestChangeOfSupplier
            {
                MarketEvaluationPoint = new MarketEvaluationPoint {
                    MRid = "571313180400153356"
                },
                StartDate = Instant.FromUtc(2020, 10, 5, 1, 0),
                BalanceResponsibleParty = new MarketParticipant("8100000000207"),
                EnergySupplier          = new MarketParticipant("5790001686758"),
                Consumer = marketParticipant,
            };

            var result = await ruleCollectionTester.InvokeAsync(initiateChangeOfSupplier).ConfigureAwait(false);

            result.Count.Should().Be(1);
            result.First().RuleNumber.Should().Be("D17");
        }
Exemplo n.º 3
0
        public async Task Input_validations_should_not_fail_for_valid_object()
        {
            var ruleCollectionTester     = RuleCollectionTester.Create <InitiateChangeOfSupplierRules, RequestChangeOfSupplier>();
            var initiateChangeOfSupplier = new RequestChangeOfSupplier
            {
                MarketEvaluationPoint = new MarketEvaluationPoint {
                    MRid = "571313180400153356"
                },
                StartDate = Instant.FromUtc(2020, 10, 5, 1, 0),
                BalanceResponsibleParty = new MarketParticipant("8100000000207"),
                EnergySupplier          = new MarketParticipant("5790001686758"),
                Consumer = new MarketParticipant("50000000")
                {
                    Qualifier = "VA"
                },
            };

            var result = await ruleCollectionTester.InvokeAsync(initiateChangeOfSupplier).ConfigureAwait(false);

            result.Count.Should().Be(0);
        }