Implemented using the filename of the specified .resw file as the generated class name
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace ChristianHelle.DeveloperTools.CodeGenerators.Resw.CustomTool.Tests
|
||||
{
|
||||
[TestClass]
|
||||
[DeploymentItem("Resources/Resources.resw")]
|
||||
public class ClassNameExtractorTests
|
||||
{
|
||||
private const string ClassName = "Resources.resw";
|
||||
|
||||
[TestMethod]
|
||||
public void DoesNotReturnNull()
|
||||
{
|
||||
var actual = ClassNameExtractor.GetClassName(ClassName);
|
||||
Assert.IsNotNull(actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ReturnsFileNameWithoutExtension()
|
||||
{
|
||||
var actual = ClassNameExtractor.GetClassName(ClassName);
|
||||
Assert.AreEqual("Resources", actual);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[ExpectedException(typeof(FileNotFoundException))]
|
||||
public void ThrowsFileNotFoundException()
|
||||
{
|
||||
ClassNameExtractor.GetClassName("C:\\Test\\Resources\\Strings.resw");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user