예제 #1
0
        public void HavingFilePathString_WhenImplicitlyCastFromString_ThenCreationTimeIsParsedCorrectly()
        {
            // arrange
            const string pathAsString = "/this/is/some/path/2021 12 31 143918.json";

            // act
            SnapshotFilePath actual = pathAsString;

            // assert
            DateTime expected = new DateTime(2021, 12, 31, 14, 39, 18);
            Assert.That(actual.CreationTime, Is.EqualTo(expected));
        }
        public void HavingSnapshotFilePathInstance_WhenImplicitlyCastToString_ThenStringContainsFullPath()
        {
            // arrange
            const string     pathAsString     = "/this/is/some/path/2021 12 31 143918.json";
            SnapshotFilePath snapshotFilePath = new SnapshotFilePath(pathAsString);

            // act
            string actual = snapshotFilePath;

            // assert
            Assert.That(actual, Is.EqualTo(pathAsString));
        }