public void QueriesDataDirectory( ModKey modKey, ISpecimenContext context, ModPathBuilder sut) { context.MockToReturn(modKey); context.MockToReturn <IDataDirectoryProvider>(); sut.Create(typeof(ModPath), context); context.ShouldHaveCreated <IDataDirectoryProvider>(); }
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); }
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(); }