public void LoadAssemblyScopedResourceWithPartialNameThroughTypeScopedResourceManagerThrows() { var sut = ResourceManagerFactory.Create <ResourceManagerFixture>(); Function(() => sut.LoadString("Stateless.Resources.Resource.txt").Should().Be("This is a resource scoped to an assembly.")) .Should().Throw <FileNotFoundException>() .WithMessage( $"Cannot find resource 'Stateless.Resources.Resource.txt' scoped to type '{typeof(ResourceManagerFixture).FullName}' in assembly '{typeof(ResourceManagerFixture).Assembly.FullName}'."); }
public void LoadTypeScopedResourceThrowsWhenNotFound() { var sut = ResourceManagerFactory.Create <ResourceManagerFixture>(); Function(() => sut.LoadString("Nonexistent.txt")) .Should().Throw <FileNotFoundException>() .WithMessage( $"Cannot find resource 'Nonexistent.txt' scoped to type '{typeof(ResourceManagerFixture).FullName}' in assembly '{typeof(ResourceManagerFixture).Assembly.FullName}'."); }
public void LoadAssemblyScopedResourceThrowsWhenNotFound() { var sut = ResourceManagerFactory.Create(Assembly.GetExecutingAssembly()); Function(() => sut.LoadString("Stateless.Resources.Unknown.txt")) .Should().Throw <FileNotFoundException>() .WithMessage( $"Cannot find resource 'Stateless.Resources.Unknown.txt' in assembly '{typeof(ResourceManagerFixture).Assembly.FullName}'."); }
public void LoadTypeSubScopedResource() { var sut = ResourceManagerFactory.Create <ResourceManagerFixture>(); sut.LoadString("Data.Resource.txt").Should().Be("This is a resource sub-scoped to a type."); }
public void LoadAssemblyScopedResourceWithPartialNameThroughAssemblyScopedResourceManager() { var sut = ResourceManagerFactory.Create(Assembly.GetExecutingAssembly()); sut.LoadString("Stateless.Resources.Resource.txt").Should().Be("This is a resource scoped to an assembly."); }
public void LoadAssemblyScopedResourceWithAbsoluteNameThroughTypeScopedResourceManager() { var sut = ResourceManagerFactory.Create <ResourceManagerFixture>(); Function(() => sut.LoadString("Be.Stateless.Resources.Resource.txt").Should().Be("This is a resource scoped to an assembly.")).Should().NotThrow(); }
public void LoadTypeSubScopedResourceWithCompositeName() { var sut = ResourceManagerFactory.Create <ResourceManagerFixture>(); sut.LoadString("Data.Resource.Composite.Name.txt").Should().Be("This is a resource with a composite name and sub-scoped to a type."); }
public void LoadAssemblyScopedResourceWithAbsoluteNameThroughAssemblyScopedResourceManager() { var sut = ResourceManagerFactory.Create(Assembly.GetExecutingAssembly()); Invoking(() => sut.LoadString("Be.Stateless.Resources.Resource.txt").Should().Be("This is a resource scoped to an assembly.")).Should().NotThrow(); }