fat-develop Mailing List for FAT Acceptance Testing Framework (Page 2)
Brought to you by:
exortech
You can subscribe to this list here.
| 2004 |
Jan
(33) |
Feb
(46) |
Mar
(10) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
|
|
From: <dmc...@us...> - 2004-02-21 22:18:53
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/test/FAT.Test/Web Added Files: TestFixtureHelpPageModelTest.cs Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. --- NEW FILE: TestFixtureHelpPageModelTest.cs --- using FAT.Core; using FAT.Web; using NMock; using NUnit.Framework; using System; using System.Web.UI; using System.Web.UI.WebControls; namespace FAT.Test.Web { [TestFixture] public class TestFixtureHelpPageModelTest : Assertion { [Test] public void CreateFixtureHelp() { IMock mockLoader = new DynamicMock(typeof(ITestFixtureLoader)); IMock mockFormatter = new DynamicMock(typeof(ITestFixtureHtmlFormatter)); Label formattedTestFixture = new Label(); formattedTestFixture.Text = "test fixture help"; mockLoader.ExpectAndReturn("GetType", typeof(object), "FATFixtureName"); mockFormatter.ExpectAndReturn("Format", formattedTestFixture, typeof(object), "FATFixtureName"); TestFixtureHelpPageModel model = new TestFixtureHelpPageModel((ITestFixtureLoader)mockLoader.MockInstance, (ITestFixtureHtmlFormatter)mockFormatter.MockInstance); AssertEquals(formattedTestFixture, model.CreateFixtureHelp("FATFixtureName")); mockLoader.Verify(); mockFormatter.Verify(); } } } |
|
From: <dmc...@us...> - 2004-02-21 19:58:52
|
Update of /cvsroot/fat/FAT/test/FAT.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/test/FAT.Test Modified Files: FAT.Test.csproj Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. Index: FAT.Test.csproj =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/FAT.Test.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FAT.Test.csproj 8 Feb 2004 16:53:24 -0000 1.7 --- FAT.Test.csproj 20 Feb 2004 17:56:51 -0000 1.8 *************** *** 163,167 **** /> <File ! RelPath = "Core\TestFixtureDescriptionTest.cs" SubType = "Code" BuildAction = "Compile" --- 163,167 ---- /> <File ! RelPath = "Core\TestFixtureHtmlFormatterTest.cs" SubType = "Code" BuildAction = "Compile" *************** *** 208,211 **** --- 208,216 ---- /> <File + RelPath = "Web\TestFixtureHelpPageModelTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Web\TestTreeViewTest.cs" SubType = "Code" |
|
From: <dmc...@us...> - 2004-02-20 23:12:27
|
Update of /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/src/FAT.Web/HtmlDetails Modified Files: HtmlDetailsEnhancer.cs Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. Index: HtmlDetailsEnhancer.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/HtmlDetailsEnhancer.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HtmlDetailsEnhancer.cs 3 Feb 2004 22:08:07 -0000 1.3 --- HtmlDetailsEnhancer.cs 20 Feb 2004 17:56:50 -0000 1.4 *************** *** 40,44 **** // absolute for all <img src="">, <form action="">, <a href=""> etc. // it's not perfect - just good enough - urls embedded in javascript etc. are not caught, ! // RegExes works only where attribute values is enclosed in "". get { --- 40,44 ---- // absolute for all <img src="">, <form action="">, <a href=""> etc. // it's not perfect - just good enough - urls embedded in javascript etc. are not caught, ! // TODO: Improve RegExes - they only work where attribute values is enclosed in "". get { *************** *** 47,50 **** --- 47,51 ---- expandingHtml = ExpandRelativeUrls(expandingHtml, "img", "src"); expandingHtml = ExpandRelativeUrls(expandingHtml, "a", "img"); + expandingHtml = ExpandRelativeUrls(expandingHtml, "link", "href"); return expandingHtml; } |
|
From: <dmc...@us...> - 2004-02-20 21:21:28
|
Update of /cvsroot/fat/FAT/src/FAT.Core/Configuration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/src/FAT.Core/Configuration Modified Files: FATConfiguration.cs IConfiguration.cs Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. Index: FATConfiguration.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/Configuration/FATConfiguration.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FATConfiguration.cs 20 Jan 2004 06:01:19 -0000 1.3 --- FATConfiguration.cs 20 Feb 2004 17:56:48 -0000 1.4 *************** *** 12,15 **** --- 12,16 ---- private string[] paths; private Type parserType; + private Type htmlFormatterType; public FATConfiguration(XmlNode root) *************** *** 17,21 **** assemblies = ParseAssemblies(root); paths = ParsePaths(root); ! parserType = ParseParserType(root); } --- 18,23 ---- assemblies = ParseAssemblies(root); paths = ParsePaths(root); ! parserType = ParseType(root, "Parser", typeof(TestParser)); ! htmlFormatterType = ParseType(root, "TestFixtureHtmlFormatter", typeof(TestFixtureHtmlFormatter)); } *************** *** 38,41 **** --- 40,44 ---- } } + return (Assembly[])assemblies.ToArray(typeof(Assembly)); } *************** *** 53,69 **** } ! private Type ParseParserType(XmlNode root) { ! XmlNode parserTypeNode = root.SelectSingleNode("Parser"); ! if (parserTypeNode != null) { ! Type parserType = Type.GetType(parserTypeNode.InnerText); ! if (parserType != null) { ! return parserType; } ! Log.Warning("Unable to load parser using type string from configuration file: " + parserTypeNode.InnerText); } ! return typeof(TestParser); } --- 56,72 ---- } ! private Type ParseType(XmlNode root, string typeNodeName, Type defaultType) { ! XmlNode typeNode = root.SelectSingleNode(typeNodeName); ! if (typeNode != null) { ! Type type = Type.GetType(typeNode.InnerText); ! if (type != null) { ! return type; } ! Log.Warning("Unable to load " + typeNodeName + "using type string from configuration file: " + typeNode.InnerText); } ! return defaultType; } *************** *** 82,85 **** --- 85,93 ---- get { return new TestRunner(new TestFixtureLoader(this)); } } + + public ITestFixtureHtmlFormatter TestFixtureHtmlFormatter + { + get { return (ITestFixtureHtmlFormatter)Activator.CreateInstance(htmlFormatterType); } + } } } Index: IConfiguration.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/Configuration/IConfiguration.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IConfiguration.cs 20 Jan 2004 06:01:19 -0000 1.2 --- IConfiguration.cs 20 Feb 2004 17:56:48 -0000 1.3 *************** *** 10,13 **** --- 10,14 ---- ITestParser TestParser { get; } ITestRunner TestRunner { get; } + ITestFixtureHtmlFormatter TestFixtureHtmlFormatter { get; } } } |
|
From: <dmc...@us...> - 2004-02-20 20:44:19
|
Update of /cvsroot/fat/FAT/src/FAT.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/src/FAT.Core Modified Files: FAT.Core.csproj TestFixtureLoader.cs Added Files: ITestFixtureHtmlFormatter.cs TestFixtureHtmlFormatter.cs Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. --- NEW FILE: ITestFixtureHtmlFormatter.cs --- using System; using System.Web.UI; namespace FAT.Core { public interface ITestFixtureHtmlFormatter { Control Format(Type type, string fixture); } } --- NEW FILE: TestFixtureHtmlFormatter.cs --- using System; using System.Collections; using System.IO; using System.Reflection; using System.Text.RegularExpressions; using System.Text; using System.Web.UI; using System.Web.UI.WebControls; namespace FAT.Core { public class TestFixtureHtmlFormatter : ITestFixtureHtmlFormatter { public Control Format(Type type, string fixture) { Table table = new Table(); table.CellSpacing = 8; table.Rows.Add(CreateHeaderRow(fixture)); foreach (MethodInfo methodInfo in GetMethodInfos(type)) { table.Rows.Add(CreateMethodRow(methodInfo)); } table.Rows.Add(CreateImplementingClassRow(type.FullName)); return table; } private TableRow CreateHeaderRow(string fixture) { TableRow row = new TableRow(); TableCell cell = CreateCell("Methods on Fixture " + fixture, 2); row.Cells.Add(cell); return row; } private TableRow CreateMethodRow(MethodInfo methodInfo) { TableRow row = new TableRow(); row.Cells.Add(CreateCell(ConvertToFATMethodName(methodInfo))); row.Cells.Add(CreateCell(GetFormattedParameterNames(methodInfo.GetParameters()))); return row; } private TableRow CreateImplementingClassRow(string typeName) { TableRow row = new TableRow(); TableCell cell = CreateCell("Implementing Class is " + typeName, 2); row.Cells.Add(cell); return row; } private TableCell CreateCell(string content) { return CreateCell(content, 1); } private TableCell CreateCell(string content, int colSpan) { TableCell cell = new TableCell(); cell.ColumnSpan = colSpan; cell.Text = content == string.Empty ? " " : content; return cell; } private MethodInfo []GetMethodInfos(Type type) { ArrayList methodInfos = new ArrayList(); foreach (Type currentType in GetAllTypesInInheritanceHeirarchy(type)) { foreach (MethodInfo methodInfo in currentType.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.DeclaredOnly)) { methodInfos.Add(methodInfo); } } return (MethodInfo [])methodInfos.ToArray(typeof(MethodInfo)); } private Type []GetAllTypesInInheritanceHeirarchy(Type type) { ArrayList baseClassTypes = new ArrayList(); for (Type currentType = type; currentType != typeof(object); currentType = currentType.BaseType) { baseClassTypes.Add(currentType); } return (Type [])baseClassTypes.ToArray(typeof(Type)); } private string ConvertToFATMethodName(MethodInfo methodInfo) { string methodName = methodInfo.Name; return methodName.Substring(0, 1) + Regex.Replace(methodName.Substring(1), "([A-Z])", " $1").ToLower().Trim() + ((methodInfo.GetParameters().Length > 0) ? ":" : ""); } private string GetFormattedParameterNames(ParameterInfo []parameterInfos) { return String.Join(" ", GetMethodParameterNamesAsStringArray(parameterInfos)); } private string []GetMethodParameterNamesAsStringArray(ParameterInfo []parameterInfos) { string []names = new string[parameterInfos.Length]; for (int n = 0; n < parameterInfos.Length; n++) { names[n] = parameterInfos[n].Name; } return names; } } } Index: FAT.Core.csproj =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/FAT.Core.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FAT.Core.csproj 8 Feb 2004 16:53:23 -0000 1.4 --- FAT.Core.csproj 20 Feb 2004 17:56:50 -0000 1.5 *************** *** 73,76 **** --- 73,81 ---- HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" /> + <Reference + Name = "System.Web" + AssemblyName = "System.Web" + HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Web.dll" + /> </References> </Build> *************** *** 128,131 **** --- 133,141 ---- /> <File + RelPath = "ITestFixtureHtmlFormatter.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ITestFixtureLoader.cs" SubType = "Code" *************** *** 203,207 **** /> <File ! RelPath = "TestFixtureDescription.cs" SubType = "Code" BuildAction = "Compile" --- 213,217 ---- /> <File ! RelPath = "TestFixtureHtmlFormatter.cs" SubType = "Code" BuildAction = "Compile" Index: TestFixtureLoader.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestFixtureLoader.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestFixtureLoader.cs 8 Feb 2004 16:53:23 -0000 1.4 --- TestFixtureLoader.cs 20 Feb 2004 17:56:50 -0000 1.5 *************** *** 23,34 **** public ITestFixture GetFixture(string fixture) { ! GetFixtureVisitor getFixtureVisitor = new GetFixtureVisitor(fixture); ! VisitFixtures(getFixtureVisitor); ! return getFixtureVisitor.Fixture; } public Type GetType(string fixture) { ! return typeof(TestFileScanner); } --- 23,34 ---- public ITestFixture GetFixture(string fixture) { ! return new TestFixture(fixture, new TestStepInvoker(GetType(fixture))); } public Type GetType(string fixture) { ! FixtureTypeFinderVisitor fixtureTypeFinderVisitor = new FixtureTypeFinderVisitor(fixture); ! VisitFixtures(fixtureTypeFinderVisitor); ! return fixtureTypeFinderVisitor.FixtureType; } *************** *** 70,79 **** } ! class GetFixtureVisitor : IFixtureVisitor { private string fixtureNameToFind; ! private TestFixture fixture = null; ! public GetFixtureVisitor(string fixtureNameTofind) { this.fixtureNameToFind = fixtureNameTofind; --- 70,79 ---- } ! class FixtureTypeFinderVisitor : IFixtureVisitor { private string fixtureNameToFind; ! private Type fixtureType = null; ! public FixtureTypeFinderVisitor(string fixtureNameTofind) { this.fixtureNameToFind = fixtureNameTofind; *************** *** 82,95 **** public void VisitFixture(string fixtureName, Type type) { ! if (fixtureName == fixtureNameToFind) fixture = new TestFixture(fixtureName, new TestStepInvoker(type)); } ! public TestFixture Fixture { ! get { ! if (fixture == null) ! { ! throw new TestFixtureLoadException(fixtureNameToFind); ! } ! return fixture; } } --- 82,93 ---- public void VisitFixture(string fixtureName, Type type) { ! if (fixtureName.Equals(fixtureNameToFind)) fixtureType = type; } ! public Type FixtureType { ! get ! { ! if (fixtureType == null) throw new TestFixtureLoadException(fixtureNameToFind); ! return fixtureType; } } |
|
From: <dmc...@us...> - 2004-02-20 18:13:54
|
Update of /cvsroot/fat/FAT/src/FAT.Web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/src/FAT.Web/images Added Files: QuestionMark.jpg Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. --- NEW FILE: QuestionMark.jpg --- (This appears to be a binary file; contents omitted.) |
|
From: <dmc...@us...> - 2004-02-20 18:13:00
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/test/FAT.Test/Core Modified Files: ConfigurationTest.cs TestFixtureLoaderTest.cs Added Files: TestFixtureHtmlFormatterTest.cs Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. --- NEW FILE: TestFixtureHtmlFormatterTest.cs --- using FAT.Core; using NUnit.Framework; using NMock; using System; using System.Web.UI; using System.Web.UI.WebControls; namespace FAT.Test.Core { [TestFixture] public class TestFixtureHtmlFormatterTest : Assertion { private TestFixtureHtmlFormatter testFixtureFormatter; [SetUp] public void CreateTestFixtureFormatter() { testFixtureFormatter = new TestFixtureHtmlFormatter(); } [Test] public void CanFormatFixture() { Table formattedTextfixture = (Table)testFixtureFormatter.Format(typeof(MyStoryFixture), "myStory"); AssertEquals("Methods on Fixture myStory", formattedTextfixture.Rows[0].Cells[0].Text); AssertEquals("Assert one plus one is two", formattedTextfixture.Rows[1].Cells[0].Text); AssertEquals(" ", formattedTextfixture.Rows[1].Cells[1].Text); AssertEquals("Assert one plus one is three", formattedTextfixture.Rows[2].Cells[0].Text); AssertEquals(" ", formattedTextfixture.Rows[2].Cells[1].Text); AssertEquals("Increment by one", formattedTextfixture.Rows[3].Cells[0].Text); AssertEquals(" ", formattedTextfixture.Rows[3].Cells[1].Text); AssertEquals("Output single argument:", formattedTextfixture.Rows[4].Cells[0].Text); AssertEquals("arg", formattedTextfixture.Rows[4].Cells[1].Text); AssertEquals("Output multiple arguments:", formattedTextfixture.Rows[5].Cells[0].Text); AssertEquals("i d l c t", formattedTextfixture.Rows[5].Cells[1].Text); AssertEquals("Implementing Class is FAT.Test.Core.MyStoryFixture", formattedTextfixture.Rows[6].Cells[0].Text); } [Test] public void MethodsInBaseClassesArePickedUp() { Table formattedTextfixture = (Table)testFixtureFormatter.Format(typeof(MyOtherStoryFixture), "myOtherStory"); AssertEquals("Methods on Fixture myOtherStory", formattedTextfixture.Rows[0].Cells[0].Text); AssertEquals("Method in sub class", formattedTextfixture.Rows[1].Cells[0].Text); AssertEquals(" ", formattedTextfixture.Rows[1].Cells[1].Text); AssertEquals("Method in base class:", formattedTextfixture.Rows[2].Cells[0].Text); AssertEquals("number", formattedTextfixture.Rows[2].Cells[1].Text); AssertEquals("Implementing Class is FAT.Test.Core.MyOtherStoryFixture", formattedTextfixture.Rows[3].Cells[0].Text); } } } Index: ConfigurationTest.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/Core/ConfigurationTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConfigurationTest.cs 20 Jan 2004 06:01:20 -0000 1.3 --- ConfigurationTest.cs 20 Feb 2004 17:56:51 -0000 1.4 *************** *** 7,10 **** --- 7,11 ---- using System.IO; using System.Reflection; + using System.Web.UI; using System.Xml; *************** *** 83,86 **** --- 84,102 ---- [Test] + public void CreateHtmlFormatterFromConfigurationXml() + { + string xml = String.Format(@"<FAT><TestFixtureHtmlFormatter>FAT.Test.Core.ConfigurationTest+MockHtmlFormatter,FAT.Test</TestFixtureHtmlFormatter></FAT>"); + ITestFixtureHtmlFormatter formatter = new FATConfiguration(LoadXml(xml)).TestFixtureHtmlFormatter; + AssertEquals(typeof(MockHtmlFormatter), formatter.GetType()); + } + + [Test] + public void CreateDefaultHtmlFormatter() + { + ITestFixtureHtmlFormatter formatter = new FATConfiguration(LoadXml("<FAT/>")).TestFixtureHtmlFormatter; + AssertEquals(typeof(TestFixtureHtmlFormatter), formatter.GetType()); + } + + [Test] public void CreateDefaultRunner() { *************** *** 100,103 **** --- 116,127 ---- } } + + class MockHtmlFormatter : ITestFixtureHtmlFormatter + { + public Control Format(Type type, string fixture) + { + return null; + } + } } } Index: TestFixtureLoaderTest.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/Core/TestFixtureLoaderTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestFixtureLoaderTest.cs 7 Feb 2004 18:11:32 -0000 1.3 --- TestFixtureLoaderTest.cs 20 Feb 2004 17:56:51 -0000 1.4 *************** *** 10,52 **** public class TestFixtureLoaderTest : Assertion { ! [Test] ! public void FindFixtureClassUsingStoryName() { ! Mock mockConfiguration = new DynamicMock(typeof(IConfiguration)); mockConfiguration.ExpectAndReturn("Assemblies", new Assembly[] { GetType().Assembly } ); ! ITestFixtureLoader fixtureLoader = new TestFixtureLoader((IConfiguration)mockConfiguration.MockInstance); ! ITestFixture fixture = fixtureLoader.GetFixture("myStory"); ! ! mockConfiguration.Verify(); ! AssertEquals(typeof(MyStoryFixture), fixture.FixtureType); } ! [Test, ExpectedException(typeof(TestFixtureLoadException))] ! public void NoFixtureClassIsMarkedUpWithStoryName() { ! Mock mockConfiguration = new DynamicMock(typeof(IConfiguration)); ! mockConfiguration.ExpectAndReturn("Assemblies", new Assembly[] { GetType().Assembly } ); ! ITestFixtureLoader fixtureLoader = new TestFixtureLoader((IConfiguration)mockConfiguration.MockInstance); ! ITestFixture fixture = fixtureLoader.GetFixture("theUnknownStory"); } [Test] ! public void FindFixtureNames() { - Mock mockConfiguration = new DynamicMock(typeof(IConfiguration)); - mockConfiguration.ExpectAndReturn("Assemblies", new Assembly[] { GetType().Assembly } ); - - ITestFixtureLoader fixtureLoader = new TestFixtureLoader((IConfiguration)mockConfiguration.MockInstance); string []fixtureNames = fixtureLoader.GetFixtureNames(); - mockConfiguration.Verify(); AssertEquals(3, fixtureNames.Length); AssertEquals("myOtherStory", fixtureNames[0]); AssertEquals("myStory", fixtureNames[1]); AssertEquals("theOtherStory", fixtureNames[2]); } } } --- 10,62 ---- public class TestFixtureLoaderTest : Assertion { ! IMock mockConfiguration; ! ITestFixtureLoader fixtureLoader; ! ! [SetUp] ! private void CreateFixtureLoader() { ! mockConfiguration = new DynamicMock(typeof(IConfiguration)); mockConfiguration.ExpectAndReturn("Assemblies", new Assembly[] { GetType().Assembly } ); ! fixtureLoader = new TestFixtureLoader((IConfiguration)mockConfiguration.MockInstance); } ! [Test] ! public void CanGetTheTypeOfAFixtureGivenTheFixtureName() { ! AssertEquals(typeof(FAT.Test.Core.TheOtherStoryFixture), fixtureLoader.GetType("theOtherStory")); ! mockConfiguration.Verify(); } + [Test] ! public void CanGetNamesOfAllAvailableFixtures() { string []fixtureNames = fixtureLoader.GetFixtureNames(); AssertEquals(3, fixtureNames.Length); AssertEquals("myOtherStory", fixtureNames[0]); AssertEquals("myStory", fixtureNames[1]); AssertEquals("theOtherStory", fixtureNames[2]); + + mockConfiguration.Verify(); } + [Test] + public void CanGetTestFixtureGivenFixtureName() + { + ITestFixture fixture = fixtureLoader.GetFixture("myStory"); + + mockConfiguration.Verify(); + AssertEquals(typeof(MyStoryFixture), fixture.FixtureType); + mockConfiguration.Verify(); + } + + [Test, ExpectedException(typeof(TestFixtureLoadException))] + public void AttemptingToLoadUnknownFixtureResultsInAnException() + { + ITestFixture fixture = fixtureLoader.GetFixture("theUnknownStory"); + } } } |
|
From: <dmc...@us...> - 2004-02-20 18:12:50
|
Update of /cvsroot/fat/FAT/test/FAT.Acceptance In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/test/FAT.Acceptance Modified Files: AcceptanceTestRunner.cs Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. Index: AcceptanceTestRunner.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Acceptance/AcceptanceTestRunner.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AcceptanceTestRunner.cs 20 Jan 2004 06:01:20 -0000 1.2 --- AcceptanceTestRunner.cs 20 Feb 2004 17:56:51 -0000 1.3 *************** *** 41,44 **** --- 41,46 ---- public ITestRunner TestRunner { get { return null; } } + + public ITestFixtureHtmlFormatter TestFixtureHtmlFormatter { get { return null; } } } } |
Update of /cvsroot/fat/FAT/src/FAT.Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3930/src/FAT.Web Modified Files: Default.aspx Default.aspx.cs FAT.Web.csproj Added Files: TestFixtureHelp.aspx TestFixtureHelp.aspx.cs TestFixtureHelp.aspx.resx TestFixtureHelpPageModel.cs Log Message: Can now click on question mark gif next to selected fixture name to get a pop-up window giving help on available methods. --- NEW FILE: TestFixtureHelp.aspx --- <%@ Page language="c#" Codebehind="TestFixtureHelp.aspx.cs" AutoEventWireup="false" Inherits="FAT.Web.TestFixtureHelp" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>FAT Test Fixture Help</title> <link media="screen" href="FAT.css" type="text/css" rel="stylesheet"> </HEAD> <body> <asp:PlaceHolder id="fixtureHelp" runat="server"></asp:PlaceHolder> </body> </HTML> --- NEW FILE: TestFixtureHelp.aspx.cs --- using System; using System.Web.UI; using System.Web.UI.WebControls; namespace FAT.Web { public class TestFixtureHelp : Page { protected System.Web.UI.WebControls.Literal help; protected PlaceHolder fixtureHelp; private void Page_Load(object sender, EventArgs e) { TestFixtureHelpPageModel model = new TestFixtureHelpPageModel(); fixtureHelp.Controls.Add(model.CreateFixtureHelp(Request["fixture"])); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } } --- NEW FILE: TestFixtureHelp.aspx.resx --- <?xml version="1.0" encoding="utf-8" ?> <root> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="ResMimeType"> <value>text/microsoft-resx</value> </resheader> <resheader name="Version"> <value>1.0.0.0</value> </resheader> <resheader name="Reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="Writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root> --- NEW FILE: TestFixtureHelpPageModel.cs --- using FAT.Core; using FAT.Core.Configuration; using System; using System.Web.UI; namespace FAT.Web { public class TestFixtureHelpPageModel { private ITestFixtureLoader loader; private ITestFixtureHtmlFormatter formatter; public TestFixtureHelpPageModel() : this(ConfigurationFactory.Create()) {} public TestFixtureHelpPageModel(IConfiguration configuration) : this(new TestFixtureLoader(configuration), configuration.TestFixtureHtmlFormatter) {} public TestFixtureHelpPageModel(ITestFixtureLoader loader, ITestFixtureHtmlFormatter formatter) { this.loader = loader; this.formatter = formatter; } public Control CreateFixtureHelp(string fixture) { Type type = loader.GetType(fixture); return formatter.Format(type, fixture); } } } Index: Default.aspx =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Default.aspx,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Default.aspx 7 Feb 2004 18:11:32 -0000 1.4 --- Default.aspx 20 Feb 2004 17:56:50 -0000 1.5 *************** *** 1,9 **** - <%@ Register Tagprefix="FAT" Namespace="FAT.Web" Assembly="FAT.Web" %> <%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="FAT.Web.Default" EnableSessionState=true %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>FAT Functional Acceptance Testing Framework</title> ! <link rel="stylesheet" href="FAT.css" media="screen" type="text/css"> </HEAD> <body> --- 1,18 ---- <%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="FAT.Web.Default" EnableSessionState=true %> + <%@ Register Tagprefix="FAT" Namespace="FAT.Web" Assembly="FAT.Web" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>FAT Functional Acceptance Testing Framework</title> ! <link media="screen" href="FAT.css" type="text/css" rel="stylesheet"> ! <script> ! function openTestfixtureHelpWindow() { ! window.open('TestFixtureHelp.aspx' + '?fixture=' + getSelectedFixture(), 'Bob', 'width=400,height=400,resizable=yes,location=no'); ! } ! ! function getSelectedFixture() { ! return document.CreateTest.fixture.options[document.CreateTest.fixture.selectedIndex].text; ! } ! </script> </HEAD> <body> *************** *** 14,52 **** <table> <tr> ! <td colspan="3"><asp:Label id="instructions" runat="server">Enter the name of the story and then enter the test to be run.</asp:Label></td> </tr> <tr> <td><asp:Label id="testNameLabel" Runat="server">Test Name: </asp:Label></td> ! <td><asp:TextBox id="testName" runat="server" Width="500" /></td> ! <td><asp:Label ID="testNameWarning" Runat="server">*</asp:Label></td> </tr> <tr> ! <td><asp:Label id="fixtureLabel" Runat="server">Fixture: </asp:Label></td> ! <td><asp:DropDownList ID="fixture" Runat="server" Width="500" /></td> ! <td><asp:Label ID="fixtureWarning" Runat="server">*</asp:Label></td> </tr> <tr> ! <td valign="top"><asp:Label id="testLabel" Runat="server">Test: </asp:Label></td> ! <td><asp:TextBox id="test" runat="server" Rows="10" TextMode="MultiLine" Width="500" /></td> ! <td valign="top">*</td> </tr> <tr> ! <td valign="top"><asp:Label id="setUpLabel" Runat="server">SetUp: </asp:Label></td> ! <td><asp:TextBox id="setup" runat="server" Rows="4" TextMode="MultiLine" Width="500" /></td> ! <td valign="top">*</td> </tr> <tr> ! <td valign="top"><asp:Label id="tearDownLabel" Runat="server">TearDown: </asp:Label></td> ! <td><asp:TextBox id="teardown" runat="server" Rows="4" TextMode="MultiLine" Width="500" /></td> ! <td valign="top">*</td> </tr> <tr> <td></td> ! <td align="right"><asp:Button ID="run" Runat="server" Text="Run" /></td> <td></td> </tr> </table> <div id="resultsDiv"> ! <asp:PlaceHolder ID="results" Runat="server"></asp:PlaceHolder> </div> </form> --- 23,72 ---- <table> <tr> ! <td colSpan="3"><asp:Label id="instructions" runat="server">Enter the name of the story and then enter the test to be run.</asp:Label></td> </tr> <tr> <td><asp:Label id="testNameLabel" Runat="server">Test Name: </asp:Label></td> ! <td><asp:Textbox id="testName" runat="server" Width="500"></asp:Textbox></td> ! <td><asp:Label id="testNameWarning" Runat="server">*</asp:Label></td> </tr> <tr> ! <td> ! <table cellpadding="0" cellspacing="0"> ! <tr> ! <td><asp:Label id="fixtureLabel" Runat="server">Fixture: </asp:Label></td> ! <td> ! <asp:HyperLink OnClick="openTestfixtureHelpWindow()" runat="server" id="HyperLink1"> ! <asp:Image ImageAlign="Right" ImageUrl="images/QuestionMark.jpg" runat="server" /> ! </asp:HyperLink> ! </td> ! </tr> ! </table> ! </td> ! <td><asp:Dropdownlist id="fixture" Runat="server" Width="500"></asp:Dropdownlist></td> ! <td><asp:Label id="fixtureWarning" Runat="server">*</asp:Label></td> </tr> <tr> ! <td vAlign="top"><asp:Label id="testLabel" Runat="server">Test: </asp:Label></td> ! <td><asp:Textbox id="test" runat="server" Width="500" TextMode="MultiLine" Rows="10"></asp:Textbox></td> ! <td vAlign="top">*</td> </tr> <tr> ! <td vAlign="top"><asp:Label id="setUpLabel" Runat="server">SetUp: </asp:Label></td> ! <td><asp:Textbox id="setup" runat="server" Width="500" TextMode="MultiLine" Rows="4"></asp:Textbox></td> ! <td vAlign="top">*</td> </tr> <tr> ! <td vAlign="top"><asp:Label id="tearDownLabel" Runat="server">TearDown: </asp:Label></td> ! <td><asp:Textbox id="teardown" runat="server" Width="500" TextMode="MultiLine" Rows="4"></asp:Textbox></td> ! <td vAlign="top">*</td> </tr> <tr> <td></td> ! <td align="right"><asp:Button id="run" Runat="server" Text="Run"></asp:Button></td> <td></td> </tr> </table> <div id="resultsDiv"> ! <asp:Placeholder id="results" Runat="server"></asp:Placeholder> </div> </form> Index: Default.aspx.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Default.aspx.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Default.aspx.cs 7 Feb 2004 18:11:32 -0000 1.4 --- Default.aspx.cs 20 Feb 2004 17:56:50 -0000 1.5 *************** *** 13,17 **** protected TextBox teardown; protected Label fixtureWarning; - protected Button run; protected Label testLabel; protected Label setUpLabel; --- 13,16 ---- *************** *** 21,26 **** --- 20,30 ---- protected Label testNameWarning; protected Label fixtureLabel; + + protected Button run; protected DropDownList fixture; protected PlaceHolder results; + protected ImageButton fixtureHelpImageButton; + protected System.Web.UI.WebControls.HyperLink HyperLink1; + private DefaultPageModel model = new DefaultPageModel(); Index: FAT.Web.csproj =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/FAT.Web.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FAT.Web.csproj 3 Feb 2004 22:08:07 -0000 1.5 --- FAT.Web.csproj 20 Feb 2004 17:56:50 -0000 1.6 *************** *** 143,146 **** --- 143,167 ---- /> <File + RelPath = "TestFixtureHelp.aspx" + SubType = "Form" + BuildAction = "Content" + /> + <File + RelPath = "TestFixtureHelp.aspx.cs" + DependentUpon = "TestFixtureHelp.aspx" + SubType = "ASPXCodeBehind" + BuildAction = "Compile" + /> + <File + RelPath = "TestFixtureHelp.aspx.resx" + DependentUpon = "TestFixtureHelp.aspx.cs" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "TestFixtureHelpPageModel.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "TestTreeView.cs" SubType = "Code" *************** *** 249,252 **** --- 270,277 ---- /> <File + RelPath = "images\QuestionMark.jpg" + BuildAction = "Content" + /> + <File RelPath = "images\Red.jpg" BuildAction = "Content" |
|
From: Darren M. <DMc...@th...> - 2004-02-08 17:43:24
|
just a thought - maybe getting the thumbnail from the
InternetExplorerClass wouldn't be such a good idea as this would couple
FAT to WebTest. The way the thumbnails are done at the moment just uses
chunks of html and so should be usable with most web test frameworks one
would want to use.
d
Owen Rogers
04/02/2004 12:42
To: Darren McGrath/UK/ThoughtWorks@ThoughtWorks
cc: fat...@li...
Subject: Re: [Fat-develop] FAT Clickable Thumbnails
ah, you got it from the russians? sure it's safe?
> Are there any issues with including a MS dll?
not that i can think of.
o.
---
R. Owen Rogers
ThoughtWorks Technologies (India) Pvt Ltd.
ThoughtWorks - Deliver with passion!
Darren McGrath
04/02/2004 02:55
To: Owen Rogers/Canada/ThoughtWorks@ThoughtWorks
cc: fat...@li...
Subject: Re: [Fat-develop] FAT Clickable Thumbnails
owen,
>> Not sure about including thumbvw.dll in a distribution though?
>why not? where does the dll come from?
I pulled it off this site:
http://dll.yaroslavl.ru/index.php3?lng=&in_char=T
I think it's a Windows 2000 dll that's not part of the standard build for
xp. Are there any issues with including a MS dll?
darren
Owen Rogers
02/02/2004 03:54
To: Darren McGrath
<DMc...@th...>@THOUGHTWORKS_COM
cc: fat...@li...
Subject: Re: [Fat-develop] FAT Clickable Thumbnails
darren,
this looks sweet. thanks for putting this together. i haven't had the
chance to try out the code yet, but i look forward to doing so.
> I'd have preferred an approach of getting images from the
InternetExplorerClass - but couldn't get it working.
i can have a look at this. it should be possible to do anything that ie
can do.
> The tweaks required to XP are a pain, maybe it's possible to make the
registry tweak at FAT start-up.
sure. seems fine with me.
> Not sure about including thumbvw.dll in a distribution though?
why not? where does the dll come from?
cheers,
o.
---
R. Owen Rogers
ThoughtWorks Technologies (India) Pvt Ltd.
ThoughtWorks - Deliver with passion!
Darren McGrath <DMc...@th...>
Sent by: fat...@li...
30/01/2004 20:45
To: "Owen Rogers <ORogers"
cc: fat...@li...
Subject: [Fat-develop] FAT Clickable Thumbnails
Owen,
Some notes on the clickable thumbnails .....
It should work fine on Windows 2000.
On Windows XP, if you can see a thumbnail of an html file in the
thumbnails view in Windows Explorer then it's working. To get it working
on my XP machine I had to :
1. Install and register C:\windows\system32\thumbvw.dll.
2. Add the following registry entries:
[HKEY_CLASSES_ROOT\.html\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@ = "{EAB841A0-9550-11cf-8C16-00805F1408F3}"
I used an approach of writing the html to a file and using the shell
extensions to get a thumbnail of the file. I'd have preferred an approach
of getting images from the InternetExplorerClass - but couldn't get it
working.
The tweaks required to XP are a pain, maybe it's possible to make the
registry tweak at FAT start-up. Not sure about including thumbvw.dll in a
distribution though?
Cheers,
Darren
|
|
From: <dmc...@us...> - 2004-02-08 16:56:40
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21286/test/FAT.Test/Core Modified Files: MyOtherStoryFixture.cs Added Files: TestFixtureDescriptionTest.cs Log Message: Added TestFixtureDescription - paves the way for text fixture help page. --- NEW FILE: TestFixtureDescriptionTest.cs --- using FAT.Core; using NUnit.Framework; using NMock; using System; namespace FAT.Test.Core { [TestFixture] public class TestFixtureDescriptionTest : Assertion { [Test] public void CanGetDescriptionDetails() { IMock mockLoader = new DynamicMock(typeof(ITestFixtureLoader)); mockLoader.ExpectAndReturn("GetType", typeof(MyStoryFixture), "myStory"); TestFixtureDescription testFixtureDescription = new TestFixtureDescription((ITestFixtureLoader)mockLoader.MockInstance, "myStory"); AssertEquals("myStory", testFixtureDescription.Fixture); AssertEquals("FAT.Test.Core.MyStoryFixture", testFixtureDescription.Type); AssertEquals(5, testFixtureDescription.Methods.Length); AssertEquals("Assert one plus one is two", testFixtureDescription.Methods[0]); AssertEquals("Assert one plus one is three", testFixtureDescription.Methods[1]); AssertEquals("Increment by one", testFixtureDescription.Methods[2]); AssertEquals("Output single argument: arg", testFixtureDescription.Methods[3]); AssertEquals("Output multiple arguments: i d l c t", testFixtureDescription.Methods[4]); mockLoader.Verify(); } [Test] public void MethodsInBaseClassesArePickedUp() { IMock mockLoader = new DynamicMock(typeof(ITestFixtureLoader)); mockLoader.ExpectAndReturn("GetType", typeof(MyOtherStoryFixture), "myOtherStory"); TestFixtureDescription testFixtureDescription = new TestFixtureDescription((ITestFixtureLoader)mockLoader.MockInstance, "myOtherStory"); AssertEquals("myOtherStory", testFixtureDescription.Fixture); AssertEquals("FAT.Test.Core.MyOtherStoryFixture", testFixtureDescription.Type); AssertEquals(2, testFixtureDescription.Methods.Length); AssertEquals("Method in sub class", testFixtureDescription.Methods[0]); AssertEquals("Method in base class: number", testFixtureDescription.Methods[1]); mockLoader.Verify(); } } } Index: MyOtherStoryFixture.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/Core/MyOtherStoryFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MyOtherStoryFixture.cs 7 Feb 2004 18:11:32 -0000 1.2 --- MyOtherStoryFixture.cs 8 Feb 2004 16:53:23 -0000 1.3 *************** *** 11,16 **** [FATFixture("myOtherStory")] ! public class MyOtherStoryFixture : Assertion { } } --- 11,22 ---- [FATFixture("myOtherStory")] ! public class MyOtherStoryFixture : MyTestBaseClass ! { ! public void MethodInSubClass() {} ! } ! ! public class MyTestBaseClass { + public void MethodInBaseClass(int number) {} } } |
|
From: <dmc...@us...> - 2004-02-08 16:56:39
|
Update of /cvsroot/fat/FAT/test/FAT.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21286/test/FAT.Test Modified Files: FAT.Test.csproj Log Message: Added TestFixtureDescription - paves the way for text fixture help page. Index: FAT.Test.csproj =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/FAT.Test.csproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FAT.Test.csproj 6 Feb 2004 20:27:34 -0000 1.6 --- FAT.Test.csproj 8 Feb 2004 16:53:24 -0000 1.7 *************** *** 163,166 **** --- 163,171 ---- /> <File + RelPath = "Core\TestFixtureDescriptionTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Core\TestFixtureLoaderTest.cs" SubType = "Code" |
|
From: <dmc...@us...> - 2004-02-08 16:56:39
|
Update of /cvsroot/fat/FAT/src/FAT.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21286/src/FAT.Core Modified Files: FAT.Core.csproj ITestFixtureLoader.cs TestFixtureLoader.cs Added Files: TestFixtureDescription.cs Log Message: Added TestFixtureDescription - paves the way for text fixture help page. --- NEW FILE: TestFixtureDescription.cs --- using System; using System.Collections; using System.Reflection; using System.Text.RegularExpressions; using System.Text; namespace FAT.Core { public class TestFixtureDescription { private string fixtureName; private Type type; public TestFixtureDescription(ITestFixtureLoader loader, string fixtureName) { this.fixtureName = fixtureName; type = loader.GetType(fixtureName); } public string Fixture { get { return fixtureName; }} public string Type { get { return type.FullName; }} public string []Methods { get { ArrayList methodDescriptions = new ArrayList(); for (Type currentType = type; currentType != typeof(object); currentType = currentType.BaseType) { foreach (MethodInfo methodInfo in currentType.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.DeclaredOnly)) { methodDescriptions.Add(ConvertToFATMethodName(methodInfo.Name) + GetMethodParameterNames(methodInfo.GetParameters())); } } return (string [])methodDescriptions.ToArray(typeof(string)); } } private string ConvertToFATMethodName(string methodName) { return methodName.Substring(0, 1) + Regex.Replace(methodName.Substring(1), "([A-Z])", " $1").ToLower().Trim(); } private string GetMethodParameterNames(ParameterInfo []parameterInfos) { return parameterInfos.Length == 0 ? string.Empty : ": " + String.Join(" ", GetMethodParameterNamesAsStringArray(parameterInfos)); } private string []GetMethodParameterNamesAsStringArray(ParameterInfo []parameterInfos) { string []names = new string[parameterInfos.Length]; for (int n = 0; n < parameterInfos.Length; n++) { names[n] = parameterInfos[n].Name; } return names; } } } Index: FAT.Core.csproj =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/FAT.Core.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FAT.Core.csproj 28 Jan 2004 22:14:47 -0000 1.3 --- FAT.Core.csproj 8 Feb 2004 16:53:23 -0000 1.4 *************** *** 203,206 **** --- 203,211 ---- /> <File + RelPath = "TestFixtureDescription.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "TestFixtureLoader.cs" SubType = "Code" Index: ITestFixtureLoader.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/ITestFixtureLoader.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ITestFixtureLoader.cs 6 Feb 2004 20:27:31 -0000 1.2 --- ITestFixtureLoader.cs 8 Feb 2004 16:53:23 -0000 1.3 *************** *** 5,10 **** public interface ITestFixtureLoader { ! ITestFixture GetFixture(string story); string []GetFixtureNames(); } } --- 5,11 ---- public interface ITestFixtureLoader { ! ITestFixture GetFixture(string fixture); string []GetFixtureNames(); + Type GetType(string fixture); } } Index: TestFixtureLoader.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestFixtureLoader.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestFixtureLoader.cs 7 Feb 2004 18:11:31 -0000 1.3 --- TestFixtureLoader.cs 8 Feb 2004 16:53:23 -0000 1.4 *************** *** 28,31 **** --- 28,36 ---- } + public Type GetType(string fixture) + { + return typeof(TestFileScanner); + } + private void VisitFixtures(IFixtureVisitor fixtureVisitor) { |
|
From: <dmc...@us...> - 2004-02-07 18:14:29
|
Update of /cvsroot/fat/FAT/src/FAT.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6233/src/FAT.Core Modified Files: TestFixtureLoader.cs Log Message: Fixtures TextBox has been changed to a DropDownList containing the names of all FATFixtures in the configured assemblies Index: TestFixtureLoader.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestFixtureLoader.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestFixtureLoader.cs 6 Feb 2004 20:27:33 -0000 1.2 --- TestFixtureLoader.cs 7 Feb 2004 18:11:31 -0000 1.3 *************** *** 62,66 **** } ! public string []FixtureNames { get {return (string [])fixtureNames.ToArray(typeof(string));} } } --- 62,66 ---- } ! public string []FixtureNames { get {fixtureNames.Sort(); return (string [])fixtureNames.ToArray(typeof(string));} } } |
|
From: <dmc...@us...> - 2004-02-07 18:14:28
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6233/test/FAT.Test/Core Modified Files: MyOtherStoryFixture.cs TestFixtureLoaderTest.cs Log Message: Fixtures TextBox has been changed to a DropDownList containing the names of all FATFixtures in the configured assemblies Index: MyOtherStoryFixture.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/Core/MyOtherStoryFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MyOtherStoryFixture.cs 6 Feb 2004 20:27:34 -0000 1.1 --- MyOtherStoryFixture.cs 7 Feb 2004 18:11:32 -0000 1.2 *************** *** 5,8 **** --- 5,13 ---- namespace FAT.Test.Core { + [FATFixture("theOtherStory")] + public class TheOtherStoryFixture : Assertion + { + } + [FATFixture("myOtherStory")] public class MyOtherStoryFixture : Assertion Index: TestFixtureLoaderTest.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/Core/TestFixtureLoaderTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestFixtureLoaderTest.cs 6 Feb 2004 20:27:34 -0000 1.2 --- TestFixtureLoaderTest.cs 7 Feb 2004 18:11:32 -0000 1.3 *************** *** 43,50 **** mockConfiguration.Verify(); ! AssertEquals(2, fixtureNames.Length); ! Array.Sort(fixtureNames); AssertEquals("myOtherStory", fixtureNames[0]); AssertEquals("myStory", fixtureNames[1]); } --- 43,50 ---- mockConfiguration.Verify(); ! AssertEquals(3, fixtureNames.Length); AssertEquals("myOtherStory", fixtureNames[0]); AssertEquals("myStory", fixtureNames[1]); + AssertEquals("theOtherStory", fixtureNames[2]); } |
|
From: <dmc...@us...> - 2004-02-07 18:14:28
|
Update of /cvsroot/fat/FAT/src/FAT.Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6233/src/FAT.Web Modified Files: Default.aspx Default.aspx.cs DefaultPageModel.cs Log Message: Fixtures TextBox has been changed to a DropDownList containing the names of all FATFixtures in the configured assemblies Index: Default.aspx =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Default.aspx,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Default.aspx 28 Jan 2004 22:14:48 -0000 1.3 --- Default.aspx 7 Feb 2004 18:11:32 -0000 1.4 *************** *** 23,27 **** <tr> <td><asp:Label id="fixtureLabel" Runat="server">Fixture: </asp:Label></td> ! <td><asp:TextBox id="fixture" runat="server" Width="500" /></td> <td><asp:Label ID="fixtureWarning" Runat="server">*</asp:Label></td> </tr> --- 23,27 ---- <tr> <td><asp:Label id="fixtureLabel" Runat="server">Fixture: </asp:Label></td> ! <td><asp:DropDownList ID="fixture" Runat="server" Width="500" /></td> <td><asp:Label ID="fixtureWarning" Runat="server">*</asp:Label></td> </tr> Index: Default.aspx.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/Default.aspx.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Default.aspx.cs 28 Jan 2004 22:14:48 -0000 1.3 --- Default.aspx.cs 7 Feb 2004 18:11:32 -0000 1.4 *************** *** 9,13 **** { protected TextBox testName; - protected TextBox fixture; protected TextBox test; protected TextBox setup; --- 9,12 ---- *************** *** 15,33 **** protected Label fixtureWarning; protected Button run; protected PlaceHolder results; ! private DefaultPageModel model; ! private void Page_Load(object sender, System.EventArgs e) { } private void Run_Click(object source, EventArgs args) { - model = new DefaultPageModel(); fixtureWarning.Text = null; try { ! ITestResult testResult = model.Run(testName.Text, fixture.Text, test.Text, setup.Text, teardown.Text); results.Controls.Add(model.CreateResultsTable(testResult, HtmlDetailsStore.Instance(new Session(Session)))); --- 14,43 ---- protected Label fixtureWarning; protected Button run; + protected Label testLabel; + protected Label setUpLabel; + protected Label tearDownLabel; + protected Label instructions; + protected Label testNameLabel; + protected Label testNameWarning; + protected Label fixtureLabel; + protected DropDownList fixture; protected PlaceHolder results; ! private DefaultPageModel model = new DefaultPageModel(); ! private void Page_Load(object sender, System.EventArgs e) { + if (!IsPostBack) + { + model.AddFixtureNamesToDropDownList(fixture); + } } private void Run_Click(object source, EventArgs args) { fixtureWarning.Text = null; try { ! ITestResult testResult = model.Run(testName.Text, fixture.SelectedItem.Text, test.Text, setup.Text, teardown.Text); results.Controls.Add(model.CreateResultsTable(testResult, HtmlDetailsStore.Instance(new Session(Session)))); Index: DefaultPageModel.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/DefaultPageModel.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DefaultPageModel.cs 3 Feb 2004 22:08:07 -0000 1.6 --- DefaultPageModel.cs 7 Feb 2004 18:11:32 -0000 1.7 *************** *** 13,25 **** private ITestParser parser; private ITestRunner runner; public DefaultPageModel() : this(ConfigurationFactory.Create()) { } ! public DefaultPageModel(IConfiguration configuration) : this(configuration.TestParser, IsolatedTestRunnerFactory.Create()) { } ! public DefaultPageModel(ITestParser parser, ITestRunner runner) { this.parser = parser; this.runner = runner; } --- 13,35 ---- private ITestParser parser; private ITestRunner runner; + private ITestFixtureLoader loader; public DefaultPageModel() : this(ConfigurationFactory.Create()) { } ! public DefaultPageModel(IConfiguration configuration) : this(configuration.TestParser, IsolatedTestRunnerFactory.Create(), new TestFixtureLoader(configuration)) { } ! public DefaultPageModel(ITestParser parser, ITestRunner runner, ITestFixtureLoader loader) { this.parser = parser; this.runner = runner; + this.loader = loader; + } + + public void AddFixtureNamesToDropDownList(DropDownList fixturesList) + { + foreach (string fixture in loader.GetFixtureNames()) + { + fixturesList.Items.Add(new ListItem(fixture, fixture)); + } } |
|
From: <dmc...@us...> - 2004-02-07 18:14:28
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6233/test/FAT.Test/Web Modified Files: CreateTestModelTest.cs Log Message: Fixtures TextBox has been changed to a DropDownList containing the names of all FATFixtures in the configured assemblies Index: CreateTestModelTest.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/Web/CreateTestModelTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CreateTestModelTest.cs 1 Feb 2004 15:22:33 -0000 1.6 --- CreateTestModelTest.cs 7 Feb 2004 18:11:32 -0000 1.7 *************** *** 14,17 **** --- 14,18 ---- private Mock mockParser; private Mock mockRunner; + private Mock mockLoader; private Mock mockHtmlDetailsStore; private DefaultPageModel model; *************** *** 22,26 **** mockParser = new DynamicMock(typeof(ITestParser)); mockRunner = new DynamicMock(typeof(ITestRunner)); ! model = new DefaultPageModel((ITestParser)mockParser.MockInstance, (ITestRunner)mockRunner.MockInstance); } --- 23,43 ---- mockParser = new DynamicMock(typeof(ITestParser)); mockRunner = new DynamicMock(typeof(ITestRunner)); ! mockLoader = new DynamicMock(typeof(ITestFixtureLoader)); ! model = new DefaultPageModel((ITestParser)mockParser.MockInstance, (ITestRunner)mockRunner.MockInstance, (ITestFixtureLoader)mockLoader.MockInstance); ! } ! ! [Test] ! public void AddFixtureNamesToFixturesDropDown() ! { ! mockLoader.ExpectAndReturn("GetFixtureNames", new string [] {"bish", "bash", "bosh"}); ! ! DropDownList fixtureDropDownList = new DropDownList(); ! ! model.AddFixtureNamesToDropDownList(fixtureDropDownList); ! ! AssertEquals(3, fixtureDropDownList.Items.Count); ! AssertEquals(new ListItem("bish", "bish"), fixtureDropDownList.Items[0]); ! AssertEquals(new ListItem("bash", "bash"), fixtureDropDownList.Items[1]); ! AssertEquals(new ListItem("bosh", "bosh"), fixtureDropDownList.Items[2]); } |
|
From: <dmc...@us...> - 2004-02-06 20:30:52
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2365/test/FAT.Test/Core Modified Files: TestFixtureLoaderTest.cs Added Files: MyOtherStoryFixture.cs Log Message: Added string []TestFixtureLoader.GetfixtureNames() which gets a list of all the fixture names in all the assemblies given in the Configuration. --- NEW FILE: MyOtherStoryFixture.cs --- using FAT.Core; using NUnit.Framework; using System; namespace FAT.Test.Core { [FATFixture("myOtherStory")] public class MyOtherStoryFixture : Assertion { } } Index: TestFixtureLoaderTest.cs =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/Core/TestFixtureLoaderTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestFixtureLoaderTest.cs 14 Dec 2003 21:30:28 -0000 1.1 --- TestFixtureLoaderTest.cs 6 Feb 2004 20:27:34 -0000 1.2 *************** *** 32,35 **** --- 32,52 ---- ITestFixture fixture = fixtureLoader.GetFixture("theUnknownStory"); } + + [Test] + public void FindFixtureNames() + { + Mock mockConfiguration = new DynamicMock(typeof(IConfiguration)); + mockConfiguration.ExpectAndReturn("Assemblies", new Assembly[] { GetType().Assembly } ); + + ITestFixtureLoader fixtureLoader = new TestFixtureLoader((IConfiguration)mockConfiguration.MockInstance); + string []fixtureNames = fixtureLoader.GetFixtureNames(); + + mockConfiguration.Verify(); + AssertEquals(2, fixtureNames.Length); + Array.Sort(fixtureNames); + AssertEquals("myOtherStory", fixtureNames[0]); + AssertEquals("myStory", fixtureNames[1]); + } + } } |
|
From: <dmc...@us...> - 2004-02-06 20:30:52
|
Update of /cvsroot/fat/FAT/test/FAT.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2365/test/FAT.Test Modified Files: FAT.Test.csproj Log Message: Added string []TestFixtureLoader.GetfixtureNames() which gets a list of all the fixture names in all the assemblies given in the Configuration. Index: FAT.Test.csproj =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/FAT.Test.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FAT.Test.csproj 3 Feb 2004 22:08:08 -0000 1.5 --- FAT.Test.csproj 6 Feb 2004 20:27:34 -0000 1.6 *************** *** 148,151 **** --- 148,156 ---- /> <File + RelPath = "Core\MyOtherStoryFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Core\MyStoryFixture.cs" SubType = "Code" |
|
From: <dmc...@us...> - 2004-02-06 20:30:29
|
Update of /cvsroot/fat/FAT/src/FAT.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2365/src/FAT.Core Modified Files: ITestFixtureLoader.cs TestFixtureLoader.cs Log Message: Added string []TestFixtureLoader.GetfixtureNames() which gets a list of all the fixture names in all the assemblies given in the Configuration. Index: ITestFixtureLoader.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/ITestFixtureLoader.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ITestFixtureLoader.cs 12 Dec 2003 23:28:50 -0000 1.1 --- ITestFixtureLoader.cs 6 Feb 2004 20:27:31 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- { ITestFixture GetFixture(string story); + string []GetFixtureNames(); } } Index: TestFixtureLoader.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestFixtureLoader.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestFixtureLoader.cs 12 Dec 2003 23:28:50 -0000 1.1 --- TestFixtureLoader.cs 6 Feb 2004 20:27:33 -0000 1.2 *************** *** 14,41 **** } public ITestFixture GetFixture(string fixture) { foreach (Assembly assembly in configuration.Assemblies) { foreach (Type type in assembly.GetTypes()) { ! if (HasCorrectTestFixtureAttribute(type, fixture)) { ! return new TestFixture(fixture, new TestStepInvoker(type)); } } } - throw new TestFixtureLoadException(fixture); } ! private bool HasCorrectTestFixtureAttribute(Type type, string fixture) { ! FATFixtureAttribute[] attributes = (FATFixtureAttribute[]) type.GetCustomAttributes(typeof(FATFixtureAttribute), false); ! foreach (FATFixtureAttribute attribute in attributes) ! { ! if (attribute.Fixture == fixture) return true; } ! return false; ! } } ! } --- 14,92 ---- } + public string []GetFixtureNames() + { + GetFixtureNamesVisitor getFixtureNamesVisitor = new GetFixtureNamesVisitor(); + VisitFixtures(getFixtureNamesVisitor); + return getFixtureNamesVisitor.FixtureNames; + } + public ITestFixture GetFixture(string fixture) { + GetFixtureVisitor getFixtureVisitor = new GetFixtureVisitor(fixture); + VisitFixtures(getFixtureVisitor); + return getFixtureVisitor.Fixture; + } + + private void VisitFixtures(IFixtureVisitor fixtureVisitor) + { foreach (Assembly assembly in configuration.Assemblies) { foreach (Type type in assembly.GetTypes()) { ! foreach (FATFixtureAttribute attribute in GetFATFixtureAttributeForType(type)) { ! fixtureVisitor.VisitFixture(attribute.Fixture, type); } } } } ! private FATFixtureAttribute[] GetFATFixtureAttributeForType(Type type) { ! return (FATFixtureAttribute[]) type.GetCustomAttributes(typeof(FATFixtureAttribute), false); ! } ! } ! ! interface IFixtureVisitor ! { ! void VisitFixture(string fixtureName, Type type); ! } ! ! class GetFixtureNamesVisitor : IFixtureVisitor ! { ! ArrayList fixtureNames = new ArrayList(); ! ! public void VisitFixture(string fixtureName, Type type) ! { ! fixtureNames.Add(fixtureName); ! } ! ! public string []FixtureNames { get {return (string [])fixtureNames.ToArray(typeof(string));} } ! } ! ! class GetFixtureVisitor : IFixtureVisitor ! { ! private string fixtureNameToFind; ! private TestFixture fixture = null; ! ! public GetFixtureVisitor(string fixtureNameTofind) ! { ! this.fixtureNameToFind = fixtureNameTofind; ! } ! ! public void VisitFixture(string fixtureName, Type type) ! { ! if (fixtureName == fixtureNameToFind) fixture = new TestFixture(fixtureName, new TestStepInvoker(type)); ! } ! ! public TestFixture Fixture { ! get { ! if (fixture == null) ! { ! throw new TestFixtureLoadException(fixtureNameToFind); ! } ! return fixture; } ! } } ! } \ No newline at end of file |
|
From: <dmc...@us...> - 2004-02-05 01:59:09
|
Update of /cvsroot/fat/FAT/src/FAT.Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17752/src/FAT.Web Modified Files: DefaultPageModel.cs FAT.Web.csproj Log Message: Refactored tests for HtmlDetailsRequestHandler. Renamed some classes. Index: DefaultPageModel.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/DefaultPageModel.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DefaultPageModel.cs 1 Feb 2004 12:27:15 -0000 1.5 --- DefaultPageModel.cs 3 Feb 2004 22:08:07 -0000 1.6 *************** *** 66,70 **** { string id = htmlDetailsStore.Add(new HtmlDetailsEnhancer(HtmlDetailsLog.Url, HtmlDetailsLog.Html)); ! return CreateImageHyperLinkCell(HtmlDetailsRequestHelper.CreateImageUrl(id), HtmlDetailsRequestHelper.CreateHtmlWithAbsoluteUrlsUrl(id), HtmlDetailsRequestHelper.CreateHtmlUrl(id)); } } --- 66,70 ---- { string id = htmlDetailsStore.Add(new HtmlDetailsEnhancer(HtmlDetailsLog.Url, HtmlDetailsLog.Html)); ! return CreateImageHyperLinkCell(HtmlDetailsRequestHandler.CreateImageUrl(id), HtmlDetailsRequestHandler.CreateHtmlWithAbsoluteUrlsUrl(id), HtmlDetailsRequestHandler.CreateHtmlUrl(id)); } } Index: FAT.Web.csproj =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/FAT.Web.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FAT.Web.csproj 1 Feb 2004 15:22:33 -0000 1.4 --- FAT.Web.csproj 3 Feb 2004 22:08:07 -0000 1.5 *************** *** 162,171 **** /> <File ! RelPath = "HtmlDetails\HtmlDetailsRequestContext.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "HtmlDetails\HtmlDetailsRequestHelper.cs" SubType = "Code" BuildAction = "Compile" --- 162,166 ---- /> <File ! RelPath = "HtmlDetails\HtmlDetailsRequestHandler.cs" SubType = "Code" BuildAction = "Compile" *************** *** 191,195 **** /> <File ! RelPath = "HtmlDetails\IHtmlDetailsRequestContext.cs" SubType = "Code" BuildAction = "Compile" --- 186,190 ---- /> <File ! RelPath = "HtmlDetails\IHtmlDetails.cs" SubType = "Code" BuildAction = "Compile" *************** *** 205,208 **** --- 200,213 ---- /> <File + RelPath = "HtmlDetails\IRequest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\IResponse.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "HtmlDetails\ISession.cs" SubType = "Code" *************** *** 215,218 **** --- 220,233 ---- /> <File + RelPath = "HtmlDetails\Request.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "HtmlDetails\Response.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "HtmlDetails\Session.cs" SubType = "Code" |
|
From: Owen R. <OR...@th...> - 2004-02-04 12:43:07
|
ah, you got it from the russians? sure it's safe? > Are there any issues with including a MS dll? not that i can think of. o. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! |---------+----------------------------> | | Darren McGrath | | | | | | 04/02/2004 02:55 | |---------+----------------------------> >--------------------------------------------------------------------------------------------------------------------------------------------------| | | | To: Owen Rogers/Canada/ThoughtWorks@ThoughtWorks | | cc: fat...@li... | | Subject: Re: [Fat-develop] FAT Clickable Thumbnails(Document link: Owen Rogers) | >--------------------------------------------------------------------------------------------------------------------------------------------------| owen, >> Not sure about including thumbvw.dll in a distribution though? >why not? where does the dll come from? I pulled it off this site: http://dll.yaroslavl.ru/index.php3?lng=&in_char=T I think it's a Windows 2000 dll that's not part of the standard build for xp. Are there any issues with including a MS dll? darren |---------+----------------------------> | | Owen Rogers | | | | | | 02/02/2004 03:54 | |---------+----------------------------> >--------------------------------------------------------------------------------------------------------------------------------------------------| | | | To: Darren McGrath <DMc...@th...>@THOUGHTWORKS_COM | | cc: fat...@li... | | Subject: Re: [Fat-develop] FAT Clickable Thumbnails(Document link: Darren McGrath) | >--------------------------------------------------------------------------------------------------------------------------------------------------| darren, this looks sweet. thanks for putting this together. i haven't had the chance to try out the code yet, but i look forward to doing so. > I'd have preferred an approach of getting images from the InternetExplorerClass - but couldn't get it working. i can have a look at this. it should be possible to do anything that ie can do. > The tweaks required to XP are a pain, maybe it's possible to make the registry tweak at FAT start-up. sure. seems fine with me. > Not sure about including thumbvw.dll in a distribution though? why not? where does the dll come from? cheers, o. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! |---------+---------------------------------------> | | Darren McGrath | | | <DMc...@th...> | | | Sent by: | | | fat...@li...| | | ceforge.net | | | | | | | | | 30/01/2004 20:45 | |---------+---------------------------------------> >--------------------------------------------------------------------------------------------------------------------------------------------------| | | | To: "Owen Rogers <ORogers" | | cc: fat...@li... | | Subject: [Fat-develop] FAT Clickable Thumbnails | >--------------------------------------------------------------------------------------------------------------------------------------------------| Owen, Some notes on the clickable thumbnails ..... It should work fine on Windows 2000. On Windows XP, if you can see a thumbnail of an html file in the thumbnails view in Windows Explorer then it's working. To get it working on my XP machine I had to : 1. Install and register C:\windows\system32\thumbvw.dll. 2. Add the following registry entries: [HKEY_CLASSES_ROOT\.html\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}] @ = "{EAB841A0-9550-11cf-8C16-00805F1408F3}" I used an approach of writing the html to a file and using the shell extensions to get a thumbnail of the file. I'd have preferred an approach of getting images from the InternetExplorerClass - but couldn't get it working. The tweaks required to XP are a pain, maybe it's possible to make the registry tweak at FAT start-up. Not sure about including thumbvw.dll in a distribution though? Cheers, Darren |
|
From: <dmc...@us...> - 2004-02-04 07:36:21
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Web/HtmlDetails In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17752/test/FAT.Test/Web/HtmlDetails Added Files: HtmlDetailsRequestHandlerTest.cs Log Message: Refactored tests for HtmlDetailsRequestHandler. Renamed some classes. --- NEW FILE: HtmlDetailsRequestHandlerTest.cs --- using FAT.Web.HtmlDetails; using NMock; using NUnit.Framework; using System; using System.Drawing; namespace FAT.Test.Web.HtmlDetails { [TestFixture] public class HtmlDetailsRequestHandlerTest { private DynamicMock mockSession; private DynamicMock mockRequest; private DynamicMock mockResponse; private HtmlDetailsRequestHandler htmlDetailsRequestHandler; private DynamicMock mockHtmlDetailsStore; private DynamicMock mockHtmlDetails; [SetUp] public void CreateHtmlDetailsRequestHandler() { mockSession = new DynamicMock(typeof(ISession)); mockRequest = new DynamicMock(typeof(IRequest)); mockResponse = new DynamicMock(typeof(IResponse)); htmlDetailsRequestHandler = new HtmlDetailsRequestHandler((ISession)mockSession.MockInstance, (IRequest)mockRequest.MockInstance, (IResponse)mockResponse.MockInstance); mockHtmlDetailsStore = new DynamicMock(typeof(IHtmlDetailsStore)); mockHtmlDetails = new DynamicMock(typeof(IHtmlDetails)); } [Test] public void ReplyWithImage() { Image image = new Bitmap(1, 1); mockResponse.Expect("ContentType", "image/jpeg"); mockRequest.ExpectAndReturn("Item", "999", "id"); mockSession.ExpectAndReturn("Item", (IHtmlDetailsStore)mockHtmlDetailsStore.MockInstance, "HtmlDetailsStore"); mockHtmlDetailsStore.ExpectAndReturn("Get", (IHtmlDetails)mockHtmlDetails.MockInstance, "999"); mockHtmlDetails.ExpectAndReturn("Thumbnail", image); mockResponse.Expect("StreamImage", image); htmlDetailsRequestHandler.ReplyWithImageDetails(); mockSession.Verify(); mockRequest.Verify(); mockResponse.Verify(); mockHtmlDetailsStore.Verify(); mockHtmlDetails.Verify(); } [Test] public void ReplyWithHtml() { string html = "<html/>"; mockResponse.Expect("ContentType", "text/plain"); mockRequest.ExpectAndReturn("Item", "111", "id"); mockSession.ExpectAndReturn("Item", (IHtmlDetailsStore)mockHtmlDetailsStore.MockInstance, "HtmlDetailsStore"); mockHtmlDetailsStore.ExpectAndReturn("Get", (IHtmlDetails)mockHtmlDetails.MockInstance, "111"); mockHtmlDetails.ExpectAndReturn("Html", html); mockResponse.Expect("StreamText", html); htmlDetailsRequestHandler.ReplyWithHtmlDetails(); mockSession.Verify(); mockRequest.Verify(); mockResponse.Verify(); mockHtmlDetailsStore.Verify(); mockHtmlDetails.Verify(); } [Test] public void ReplyWithHtmlWithAbsoluteUrls() { string htmlWithAbsoluteUrls = @"<a href=""http://absolute/url.gif""/>"; mockResponse.Expect("ContentType", "text/plain"); mockRequest.ExpectAndReturn("Item", "111", "id"); mockSession.ExpectAndReturn("Item", (IHtmlDetailsStore)mockHtmlDetailsStore.MockInstance, "HtmlDetailsStore"); mockHtmlDetailsStore.ExpectAndReturn("Get", (IHtmlDetails)mockHtmlDetails.MockInstance, "111"); mockHtmlDetails.ExpectAndReturn("HtmlWithAbsoluteUrls", htmlWithAbsoluteUrls); mockResponse.Expect("StreamText", htmlWithAbsoluteUrls); htmlDetailsRequestHandler.ReplyWithHtmlWithAbsoluteUrlsDetails(); mockSession.Verify(); mockRequest.Verify(); mockResponse.Verify(); mockHtmlDetailsStore.Verify(); mockHtmlDetails.Verify(); } [Test] public void CreateImageUrl() { Assert.AreEqual("HtmlDetails/Image.ashx?id=999", HtmlDetailsRequestHandler.CreateImageUrl("999")); } [Test] public void CreateHtmlUrl() { Assert.AreEqual("HtmlDetails/Html.ashx?id=999", HtmlDetailsRequestHandler.CreateHtmlUrl("999")); } [Test] public void CreateHtmlWithAbsoluteUrlsUrl() { Assert.AreEqual("HtmlDetails/HtmlWithAbsoluteUrls.ashx?id=999", HtmlDetailsRequestHandler.CreateHtmlWithAbsoluteUrlsUrl("999")); } } } |
|
From: <dmc...@us...> - 2004-02-04 07:36:20
|
Update of /cvsroot/fat/FAT/test/FAT.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17752/test/FAT.Test Modified Files: FAT.Test.csproj Log Message: Refactored tests for HtmlDetailsRequestHandler. Renamed some classes. Index: FAT.Test.csproj =================================================================== RCS file: /cvsroot/fat/FAT/test/FAT.Test/FAT.Test.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FAT.Test.csproj 28 Jan 2004 22:14:49 -0000 1.4 --- FAT.Test.csproj 3 Feb 2004 22:08:08 -0000 1.5 *************** *** 208,212 **** /> <File ! RelPath = "Web\HtmlDetails\HtmlDetailsRequestHelperTest.cs" SubType = "Code" BuildAction = "Compile" --- 208,212 ---- /> <File ! RelPath = "Web\HtmlDetails\HtmlDetailsRequestHandlerTest.cs" SubType = "Code" BuildAction = "Compile" |
|
From: <dmc...@us...> - 2004-02-04 02:04:07
|
Update of /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17752/src/FAT.Web/HtmlDetails Modified Files: Html.ashx HtmlDetailsEnhancer.cs HtmlDetailsStore.cs HtmlWithAbsoluteUrls.ashx IHtmlDetailsStore.cs ISession.cs Image.ashx Added Files: HtmlDetailsRequestHandler.cs IHtmlDetails.cs IRequest.cs IResponse.cs Request.cs Response.cs Log Message: Refactored tests for HtmlDetailsRequestHandler. Renamed some classes. --- NEW FILE: HtmlDetailsRequestHandler.cs --- using System.Drawing.Imaging; using System.IO; using System.Web.SessionState; namespace FAT.Web.HtmlDetails { public class HtmlDetailsRequestHandler { private const string URL_PATH = "HtmlDetails/"; public const string IMAGE_HANDLER_RELATIVE_URL = URL_PATH + "Image.ashx"; public const string HTML_HANDLER_RELATIVE_URL = URL_PATH + "Html.ashx"; public const string HTML_WITH_ABSOLUTE_URLS_HANDLER_RELATIVE_URL = URL_PATH + "HtmlWithAbsoluteUrls.ashx"; public const string ID_PARAMETER_NAME = "id"; private ISession session; private IRequest request; private IResponse response; public HtmlDetailsRequestHandler(ISession session, IRequest request, IResponse response) { this.session = session; this.request = request; this.response = response; } public void ReplyWithImageDetails() { response.ContentType="image/jpeg"; IHtmlDetails htmlDetails = GetHtmlDetails(); response.StreamImage(htmlDetails.Thumbnail); } public void ReplyWithHtmlDetails() { response.ContentType="text/plain"; IHtmlDetails htmlDetails = GetHtmlDetails(); response.StreamText(htmlDetails.Html); } public void ReplyWithHtmlWithAbsoluteUrlsDetails() { response.ContentType="text/plain"; IHtmlDetails htmlDetails = GetHtmlDetails(); response.StreamText(htmlDetails.HtmlWithAbsoluteUrls); } public static string CreateImageUrl(string id) { return IMAGE_HANDLER_RELATIVE_URL + "?" + CreateHtmlDetailsIdParameter(id); } public static string CreateHtmlUrl(string id) { return HTML_HANDLER_RELATIVE_URL + "?" + CreateHtmlDetailsIdParameter(id); } public static string CreateHtmlWithAbsoluteUrlsUrl(string id) { return HTML_WITH_ABSOLUTE_URLS_HANDLER_RELATIVE_URL + "?" + CreateHtmlDetailsIdParameter(id); } private static string CreateHtmlDetailsIdParameter(string id) { return ID_PARAMETER_NAME + "=" + id; } private IHtmlDetails GetHtmlDetails() { string id = GetDetailsIdFromRequest(request); IHtmlDetailsStore htmlDetailsStore = HtmlDetailsStore.Instance(session); return htmlDetailsStore.Get(id); } private string GetDetailsIdFromRequest(IRequest request) { return (string)request[ID_PARAMETER_NAME]; } } } --- NEW FILE: IHtmlDetails.cs --- using System; using System.Drawing; namespace FAT.Web.HtmlDetails { public interface IHtmlDetails { string Url {get;} string Html {get;} string HtmlWithAbsoluteUrls {get;} Image Thumbnail {get;} } } --- NEW FILE: IRequest.cs --- using System; namespace FAT.Web.HtmlDetails { public interface IRequest { object this[string key] {get;} } } --- NEW FILE: IResponse.cs --- using System; using System.Drawing; namespace FAT.Web.HtmlDetails { public interface IResponse { string ContentType { set; } void StreamText(string text); void StreamImage(Image image); } } --- NEW FILE: Request.cs --- using System; using System.Web; namespace FAT.Web.HtmlDetails { public class Request : IRequest { private HttpRequest request; public Request(HttpRequest request) { this.request = request; } public object this[string key] { get {return request[key];} } } } --- NEW FILE: Response.cs --- using System; using System.Web; using System.Drawing; using System.Drawing.Imaging; using System.IO; namespace FAT.Web.HtmlDetails { public class Response : IResponse { private HttpResponse response; public Response(HttpResponse response) { this.response = response; } public string ContentType { set { response.ContentType = value; } } public void StreamImage(Image image) { image.Save(response.OutputStream, ImageFormat.Jpeg); } public void StreamText(string text) { using (StreamWriter writer = new StreamWriter(response.OutputStream)) { writer.Write(text); } } } } Index: Html.ashx =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/Html.ashx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Html.ashx 1 Feb 2004 15:22:33 -0000 1.1 --- Html.ashx 3 Feb 2004 22:08:07 -0000 1.2 *************** *** 12,16 **** public void ProcessRequest(HttpContext context) { ! HtmlDetailsRequestHelper.ReplyWithHtmlDetails(new HtmlDetailsRequestContext(context)); } --- 12,17 ---- public void ProcessRequest(HttpContext context) { ! HtmlDetailsRequestHandler htmlDetailsRequestHandler = new HtmlDetailsRequestHandler(new Session(context.Session), new Request(context.Request), new Response(context.Response)); ! htmlDetailsRequestHandler.ReplyWithHtmlDetails(); } Index: HtmlDetailsEnhancer.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/HtmlDetailsEnhancer.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HtmlDetailsEnhancer.cs 1 Feb 2004 12:27:15 -0000 1.2 --- HtmlDetailsEnhancer.cs 3 Feb 2004 22:08:07 -0000 1.3 *************** *** 7,11 **** namespace FAT.Web.HtmlDetails { ! public class HtmlDetailsEnhancer { private const int screenWidth = 1050; --- 7,11 ---- namespace FAT.Web.HtmlDetails { ! public class HtmlDetailsEnhancer : IHtmlDetails { private const int screenWidth = 1050; Index: HtmlDetailsStore.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/HtmlDetailsStore.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HtmlDetailsStore.cs 28 Jan 2004 22:14:49 -0000 1.1 --- HtmlDetailsStore.cs 3 Feb 2004 22:08:07 -0000 1.2 *************** *** 24,36 **** } ! public HtmlDetailsEnhancer Get(string id) { ! return (HtmlDetailsEnhancer)cache[id]; } ! public string Add(HtmlDetailsEnhancer htmlDetailsEnhancer) { string id = GetNextId(); ! cache.Add(id, htmlDetailsEnhancer); return id; } --- 24,36 ---- } ! public IHtmlDetails Get(string id) { ! return (IHtmlDetails)cache[id]; } ! public string Add(IHtmlDetails htmlDetails) { string id = GetNextId(); ! cache.Add(id, htmlDetails); return id; } Index: HtmlWithAbsoluteUrls.ashx =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/HtmlWithAbsoluteUrls.ashx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HtmlWithAbsoluteUrls.ashx 1 Feb 2004 15:22:33 -0000 1.1 --- HtmlWithAbsoluteUrls.ashx 3 Feb 2004 22:08:07 -0000 1.2 *************** *** 12,16 **** public void ProcessRequest(HttpContext context) { ! HtmlDetailsRequestHelper.ReplyWithHtmlWithAbsoluteUrlsDetails(new HtmlDetailsRequestContext(context)); } --- 12,17 ---- public void ProcessRequest(HttpContext context) { ! HtmlDetailsRequestHandler htmlDetailsRequestHandler = new HtmlDetailsRequestHandler(new Session(context.Session), new Request(context.Request), new Response(context.Response)); ! htmlDetailsRequestHandler.ReplyWithHtmlWithAbsoluteUrlsDetails(); } Index: IHtmlDetailsStore.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/IHtmlDetailsStore.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IHtmlDetailsStore.cs 28 Jan 2004 22:14:49 -0000 1.1 --- IHtmlDetailsStore.cs 3 Feb 2004 22:08:07 -0000 1.2 *************** *** 6,11 **** public interface IHtmlDetailsStore { ! HtmlDetailsEnhancer Get(string id); ! string Add(HtmlDetailsEnhancer htmlDetailsEnhancer); } } --- 6,11 ---- public interface IHtmlDetailsStore { ! IHtmlDetails Get(string id); ! string Add(IHtmlDetails htmlDetails); } } Index: ISession.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/ISession.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ISession.cs 28 Jan 2004 22:14:49 -0000 1.1 --- ISession.cs 3 Feb 2004 22:08:07 -0000 1.2 *************** *** 6,10 **** public interface ISession { ! object this[string stringIndex] {get; set;} } } --- 6,10 ---- public interface ISession { ! object this[string key] {get; set;} } } Index: Image.ashx =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Web/HtmlDetails/Image.ashx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Image.ashx 1 Feb 2004 15:22:33 -0000 1.1 --- Image.ashx 3 Feb 2004 22:08:07 -0000 1.2 *************** *** 12,16 **** public void ProcessRequest(HttpContext context) { ! HtmlDetailsRequestHelper.ReplyWithImageDetails(new HtmlDetailsRequestContext(context)); } --- 12,17 ---- public void ProcessRequest(HttpContext context) { ! HtmlDetailsRequestHandler htmlDetailsRequestHandler = new HtmlDetailsRequestHandler(new Session(context.Session), new Request(context.Request), new Response(context.Response)); ! htmlDetailsRequestHandler.ReplyWithImageDetails(); } |