示例#1
0
        public void QueriesDataDirectory(
            ModKey modKey,
            ISpecimenContext context,
            ModPathBuilder sut)
        {
            context.MockToReturn(modKey);
            context.MockToReturn <IDataDirectoryProvider>();

            sut.Create(typeof(ModPath), context);

            context.ShouldHaveCreated <IDataDirectoryProvider>();
        }
示例#2
0
        public void ReturnsModPathWithModKeyMatchingPath(
            ModKey modKey,
            DirectoryPath directoryPath,
            IDataDirectoryProvider dataDirectoryProvider,
            ISpecimenContext context,
            ModPathBuilder sut)
        {
            context.MockToReturn(modKey);
            dataDirectoryProvider.Path.Returns(directoryPath);
            context.MockToReturn(dataDirectoryProvider);

            var ret = sut.Create(typeof(ModPath), context);

            ret.Should().BeOfType <ModPath>();
            var modPath = (ModPath)ret;

            modPath.Path.Name.Should().Be(modPath.ModKey.FileName);
        }
示例#3
0
        public void ReturnsModPathWithinDataDirectory(
            ModKey modKey,
            DirectoryPath directoryPath,
            IDataDirectoryProvider dataDirectoryProvider,
            ISpecimenContext context,
            ModPathBuilder sut)
        {
            context.MockToReturn(modKey);
            dataDirectoryProvider.Path.Returns(directoryPath);
            context.MockToReturn(dataDirectoryProvider);

            var ret = sut.Create(typeof(ModPath), context);

            ret.Should().BeOfType <ModPath>();
            var modPath = (ModPath)ret;

            modPath.Path.IsUnderneath(directoryPath).Should().BeTrue();
        }