Esempio n. 1
0
        public IResult <TestCaseStarted> BuildTestCaseStartedMessage(Guid pickleId, DateTime timeStamp)
        {
            if (timeStamp.Kind != DateTimeKind.Utc)
            {
                return(Result <TestCaseStarted> .Failure($"{nameof(timeStamp)} must be an UTC {nameof(DateTime)}. It is {timeStamp.Kind}"));
            }

            var testCaseStarted = new TestCaseStarted
            {
                Timestamp = Timestamp.FromDateTime(timeStamp),
                PickleId  = ConvertToPickleIdString(pickleId)
            };

            return(Result <TestCaseStarted> .Success(testCaseStarted));
        }
        public IResult <TestCaseStarted> BuildTestCaseStartedMessage(Guid pickleId, DateTime timeStamp, Platform platform)
        {
            if (platform is null)
            {
                return(Result <TestCaseStarted> .Failure($"The {nameof(platform)} parameter must not be null"));
            }

            if (timeStamp.Kind != DateTimeKind.Utc)
            {
                return(Result <TestCaseStarted> .Failure($"{nameof(timeStamp)} must be an UTC {nameof(DateTime)}. It is {timeStamp.Kind}"));
            }

            var testCaseStarted = new TestCaseStarted
            {
                Timestamp = Timestamp.FromDateTime(timeStamp),
                PickleId  = ConvertToPickleIdString(pickleId),
                Platform  = platform
            };

            return(Result <TestCaseStarted> .Success(testCaseStarted));
        }