public void StoreAsVariableCurrentDate(string varName)
        {
            this.variableController.Variables.Should().NotContainKey(varName, $"переменная \"{varName}\" уже существует");

            var now = fakerGenerator.Current();

            this.variableController.SetVariable(varName, now.GetType(), now);
        }
Beispiel #2
0
        public void GetCurrentDateTime_ReturnCurrentDateTime()
        {
            var mockDateTimeHelper = new Mock <IDateTimeHelper>();
            var fakeDate           = new DateTime(2000, 1, 1, 1, 1, 1);

            mockDateTimeHelper.Setup(o => o.GetDateTimeNow())
            .Returns(fakeDate);
            ((FakerGenerator)generator).DateTimeHelper.Value = mockDateTimeHelper.Object;
            var dt = generator.Current();

            dt.Should().Be(fakeDate);
        }