Пример #1
0
        public void TransformFromSecondsA()
        {
            UnityEventListenerMock transformedListenerMock = new UnityEventListenerMock();

            subject.Transformed.AddListener(transformedListenerMock.Listen);

            Assert.AreEqual(SystemTimeSpan.Zero, subject.Result);
            Assert.IsFalse(transformedListenerMock.Received);

            SystemTimeSpan result = subject.Transform(120f);

            Assert.AreEqual("00:02:00", result.ToString());
            Assert.AreEqual("00:02:00", subject.Result.ToString());
            Assert.IsTrue(transformedListenerMock.Received);
        }
Пример #2
0
        public void TransformFromHours()
        {
            UnityEventListenerMock transformedListenerMock = new UnityEventListenerMock();

            subject.Transformed.AddListener(transformedListenerMock.Listen);
            subject.TimeSpanValue = FloatToTimeSpan.TimeSpanProperty.Hours;

            Assert.AreEqual(SystemTimeSpan.Zero, subject.Result);
            Assert.IsFalse(transformedListenerMock.Received);

            SystemTimeSpan result = subject.Transform(2.5f);

            Assert.AreEqual("02:30:00", result.ToString());
            Assert.AreEqual("02:30:00", subject.Result.ToString());
            Assert.IsTrue(transformedListenerMock.Received);
        }