Exemple #1
0
        public void CurrentDateTimeExtracter_Extract(string paramName, string format, string expectedResult)
        {
            var options = new CurrentDateTimeDescriptionOptions(format, paramName, ExtractFileType.Input, "");
            var ctx     = _xmlDataFixture.GetParameterContext();

            ctx.XmlRootInput = _xmlDataFixture.GetXmlElement();
            var result = new CurrentDateTimeExtracter(options, null).Extract(ctx);

            result.Should().BeOfType <Dictionary <string, string> >()
            .And.HaveCount(1);
            result[paramName].Should().Be(expectedResult);
        }
Exemple #2
0
        public void CurrentDateTimeExtracter_Extract_CheckCallNextDictionary()
        {
            var options = new CurrentDateTimeDescriptionOptions("yyyyMMdd", "Param", ExtractFileType.Input, "0");
            var ctx     = _xmlDataFixture.GetParameterContext();

            ctx.XmlRootInput = _xmlDataFixture.GetXmlElement();
            var nextMock = new MockParameterExtracterBase(null);

            var result = new CurrentDateTimeExtracter(options, nextMock).Extract(ctx);

            result.Should().BeOfType <Dictionary <string, string> >()
            .And.HaveCount(4);
            result["FP1"].Should().Be("1");
            result["FP2"].Should().Be("2");
            result["FP3"].Should().Be("3");
        }