├── lib ├── log4net.dll ├── FakeItEasy.dll ├── nunit.framework.dll └── FakeItEasy.xml ├── .gitignore ├── src ├── PostLog │ ├── HttpAppenderAttribute.cs │ ├── IBodyFormatter.cs │ ├── PostLog.nuspec │ ├── XmlBodyFormatter.cs │ ├── FormBodyFormatter.cs │ ├── JsonBodyFormatter.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── HttpAppender.cs │ └── PostLog.csproj └── PostLog.Tests │ ├── Properties │ └── AssemblyInfo.cs │ ├── app.config │ ├── HttpAppenderTests.cs │ ├── BodyFormatterTests.cs │ └── PostLog.Tests.csproj ├── PostLog.sln └── README.markdown /lib/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statianzo/PostLog/HEAD/lib/log4net.dll -------------------------------------------------------------------------------- /lib/FakeItEasy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statianzo/PostLog/HEAD/lib/FakeItEasy.dll -------------------------------------------------------------------------------- /lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statianzo/PostLog/HEAD/lib/nunit.framework.dll -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | build 4 | _ReSharper.* 5 | *.csproj.user 6 | *.resharper.user 7 | *.ReSharper.user 8 | *.suo 9 | 10 | -------------------------------------------------------------------------------- /src/PostLog/HttpAppenderAttribute.cs: -------------------------------------------------------------------------------- 1 | using log4net.Layout; 2 | 3 | namespace PostLog 4 | { 5 | public class HttpAppenderAttribute 6 | { 7 | public string Name { get; set; } 8 | public IRawLayout Layout { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/PostLog/IBodyFormatter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using log4net.Core; 3 | 4 | namespace PostLog 5 | { 6 | public interface IBodyFormatter 7 | { 8 | string CreateBody(LoggingEvent loggingEvent, IEnumerable parameters); 9 | 10 | string ContentType { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/PostLog/PostLog.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | log4net.PostLog 5 | 0.2 6 | Log4Net PostLog 7 | statianzo 8 | matthewsteeples 9 | https://github.com/statianzo/PostLog 10 | An HttpAppender for log4net 11 | Copyright 2016 12 | log4net logging 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/PostLog/XmlBodyFormatter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Xml.Linq; 3 | using log4net.Core; 4 | 5 | namespace PostLog 6 | { 7 | public class XmlBodyFormatter:IBodyFormatter 8 | { 9 | public string CreateBody(LoggingEvent loggingEvent, IEnumerable parameters) 10 | { 11 | var root = new XElement("log"); 12 | foreach (HttpAppenderAttribute attribute in parameters) 13 | root.Add(new XElement(attribute.Name, attribute.Layout.Format(loggingEvent))); 14 | 15 | return root.ToString(SaveOptions.DisableFormatting); 16 | } 17 | 18 | public string ContentType 19 | { 20 | get { return "text/xml"; } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/PostLog/FormBodyFormatter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Web; 3 | using log4net.Core; 4 | 5 | namespace PostLog 6 | { 7 | public class FormBodyFormatter:IBodyFormatter 8 | { 9 | public string CreateBody(LoggingEvent loggingEvent, IEnumerable parameters) 10 | { 11 | var formatted = new List(); 12 | foreach (HttpAppenderAttribute attribute in parameters) 13 | { 14 | object value = attribute.Layout.Format(loggingEvent); 15 | formatted.Add(string.Format("{0}={1}", attribute.Name, HttpUtility.UrlEncode(value.ToString()))); 16 | } 17 | return string.Join("&", formatted.ToArray()); 18 | } 19 | 20 | public string ContentType 21 | { 22 | get { return "application/x-www-form-urlencoded"; } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/PostLog/JsonBodyFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Web.Script.Serialization; 4 | using System.Xml; 5 | using log4net.Core; 6 | 7 | namespace PostLog 8 | { 9 | public class JsonBodyFormatter : IBodyFormatter 10 | { 11 | private readonly JavaScriptSerializer _serializer; 12 | 13 | public JsonBodyFormatter() 14 | { 15 | _serializer = new JavaScriptSerializer(); 16 | } 17 | public string CreateBody(LoggingEvent loggingEvent, IEnumerable parameters) 18 | { 19 | var formattedAttributes = new Dictionary(); 20 | foreach (HttpAppenderAttribute attribute in parameters) 21 | { 22 | var value = attribute.Layout.Format(loggingEvent); 23 | if (value is DateTime) 24 | value = ConvertDateTime((DateTime)value); 25 | formattedAttributes[attribute.Name] = value; 26 | } 27 | return _serializer.Serialize(formattedAttributes); 28 | } 29 | 30 | private static string ConvertDateTime(DateTime date) 31 | { 32 | return XmlConvert.ToString(date,XmlDateTimeSerializationMode.Unspecified); 33 | } 34 | 35 | public string ContentType 36 | { 37 | get { return "application/json"; } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/PostLog/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("LogPost")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("LogPost")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b396eb7e-9355-4af9-8d8c-7d77b6b93818")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/PostLog.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PostLog.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("PostLog.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("19068e6b-24df-4c5a-a551-4c0f0b53e1cb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/PostLog.Tests/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/PostLog.Tests/HttpAppenderTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using System.Threading; 5 | using FakeItEasy; 6 | using log4net; 7 | using log4net.Config; 8 | using log4net.Core; 9 | using log4net.Layout; 10 | using NUnit.Framework; 11 | 12 | namespace PostLog.Tests 13 | { 14 | [TestFixture] 15 | public class HttpAppenderTests 16 | { 17 | [SetUp] 18 | public void Setup() 19 | { 20 | _appender = new HttpAppender(); 21 | } 22 | 23 | private HttpAppender _appender; 24 | 25 | [Test] 26 | public void ShouldCreateFormatter() 27 | { 28 | var formatterName = typeof (JsonBodyFormatter).FullName; 29 | var formatter = _appender.ConstructFormatter(formatterName); 30 | Assert.IsInstanceOf(formatter); 31 | } 32 | 33 | [Test] 34 | public void ShouldConfigure() 35 | { 36 | XmlConfigurator.Configure(); 37 | ILog logger = LogManager.GetLogger(typeof(HttpAppenderTests)); 38 | 39 | using (var listener = new HttpListener()) 40 | { 41 | listener.Prefixes.Add("http://localhost:34343/"); 42 | listener.AuthenticationSchemes = AuthenticationSchemes.Basic; 43 | listener.Start(); 44 | 45 | try 46 | { 47 | throw new Exception("KABOOM!"); 48 | } 49 | catch (Exception e) 50 | { 51 | logger.Error("Oh noes!", e); 52 | } 53 | 54 | var ctx = listener.GetContext(); 55 | using (var reader = new StreamReader(ctx.Request.InputStream)) 56 | { 57 | var body = reader.ReadToEnd(); 58 | Console.WriteLine(body); 59 | Assert.IsNotNull(body); 60 | 61 | HttpListenerBasicIdentity identity = (HttpListenerBasicIdentity)ctx.User.Identity; 62 | Assert.AreEqual("derp", identity.Name); 63 | Assert.AreEqual("darp", identity.Password); 64 | } 65 | ctx.Response.Close(); 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /PostLog.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostLog", "src\PostLog\PostLog.csproj", "{A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostLog.Tests", "src\PostLog.Tests\PostLog.Tests.csproj", "{4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|x86 = Debug|x86 14 | Release|Any CPU = Release|Any CPU 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}.Debug|x86.ActiveCfg = Debug|x86 21 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}.Debug|x86.Build.0 = Debug|x86 22 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}.Release|x86.ActiveCfg = Release|x86 24 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE}.Release|x86.Build.0 = Release|x86 25 | {4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4}.Debug|x86.ActiveCfg = Debug|Any CPU 28 | {4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4}.Release|x86.ActiveCfg = Release|Any CPU 31 | EndGlobalSection 32 | GlobalSection(SolutionProperties) = preSolution 33 | HideSolutionNode = FALSE 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /src/PostLog.Tests/BodyFormatterTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using FakeItEasy; 4 | using log4net.Core; 5 | using log4net.Layout; 6 | using NUnit.Framework; 7 | 8 | namespace PostLog.Tests 9 | { 10 | [TestFixture] 11 | public class BodyFormatterTests 12 | { 13 | private List _parameters; 14 | 15 | [SetUp] 16 | public void Setup() 17 | { 18 | _parameters = new List(); 19 | } 20 | 21 | private void AddParameter(string name) 22 | { 23 | var attribute = CreateAttribute(name, "value-of-" + name); 24 | _parameters.Add(attribute); 25 | } 26 | 27 | private static HttpAppenderAttribute CreateAttribute(string name, object value) 28 | { 29 | var layout = A.Fake(); 30 | A.CallTo(() => layout.Format(A.Ignored)).Returns(value); 31 | var attribute = new HttpAppenderAttribute 32 | { 33 | Name = name, 34 | Layout = layout 35 | }; 36 | return attribute; 37 | } 38 | [Test] 39 | public void ShouldCreateFormBody() 40 | { 41 | const string expected = "thread=value-of-thread&message=value-of-message&exception=value-of-exception"; 42 | TestFormatter(expected, "thread", "message", "exception"); 43 | } 44 | 45 | [Test] 46 | public void ShouldEscapeFormCharacters() 47 | { 48 | const string expected = "escape=+%2c%24%25!%7e.*"; 49 | 50 | var attr = CreateAttribute("escape", " ,$%!~.*"); 51 | _parameters.Add(attr); 52 | TestFormatter(expected); 53 | } 54 | 55 | [Test] 56 | public void ShouldCreateJsonBody() 57 | { 58 | const string expected = 59 | @"{""thread"":""value-of-thread"",""message"":""value-of-message"",""exception"":""value-of-exception""}"; 60 | TestFormatter(expected, "thread", "message", "exception"); 61 | } 62 | 63 | [Test] 64 | public void ShouldUseIsoDateTime() 65 | { 66 | var date = new DateTime(2011, 2, 3, 4, 5, 6, 7); 67 | var attribute = CreateAttribute("date", date); 68 | _parameters.Add(attribute); 69 | 70 | 71 | const string expected = 72 | @"{""date"":""2011-02-03T04:05:06.007""}"; 73 | TestFormatter(expected); 74 | } 75 | 76 | [Test] 77 | public void ShouldCreateXmlBody() 78 | { 79 | const string expected = 80 | "value-of-threadvalue-of-messagevalue-of-exception"; 81 | TestFormatter(expected, "thread", "message", "exception"); 82 | } 83 | 84 | private void TestFormatter(string expected, params string[] attributes) where TBuilder: IBodyFormatter, new() 85 | { 86 | var builder = new TBuilder(); 87 | var e = new LoggingEvent(new LoggingEventData()); 88 | foreach (var a in attributes) 89 | { 90 | AddParameter(a); 91 | } 92 | string body = builder.CreateBody(e, _parameters); 93 | Assert.AreEqual(expected, body); 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | PostLog 2 | === 3 | 4 | PostLog is an appender for log4net designed to submit log messages via HTTP. 5 | 6 | Configuration 7 | --- 8 | 9 | PostLog's `HttpAppender` is configured in the `log4net` app.config section. 10 | Several options are available. 11 | 12 | - `uri` The location to send the HTTP Request 13 | - `method` The HTTP method to be used (defaults to POST) 14 | - `useragent` The value of the useragent header 15 | - `formatterType` The IBodyFormatter implementation to serialize logs 16 | 17 | Also, you must add `parameter` tags for each value that is sent. 18 | 19 | Example 20 | --- 21 | ```xml 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ``` 54 | License 55 | --- 56 | 57 | The MIT License 58 | 59 | Copyright (c) 2010-2011 Jason Staten 60 | 61 | Permission is hereby granted, free of charge, to any person obtaining a copy 62 | of this software and associated documentation files (the "Software"), to deal 63 | in the Software without restriction, including without limitation the rights 64 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 65 | copies of the Software, and to permit persons to whom the Software is 66 | furnished to do so, subject to the following conditions: 67 | 68 | The above copyright notice and this permission notice shall be included in 69 | all copies or substantial portions of the Software. 70 | 71 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 72 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 73 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 74 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 75 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 76 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 77 | THE SOFTWARE. 78 | 79 | 80 | 81 | [nugget]: http://nugget.codeplex.com/ 82 | -------------------------------------------------------------------------------- /src/PostLog.Tests/PostLog.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {4BB11B2E-A48C-4D2B-ACC2-C910EF482BC4} 9 | Library 10 | Properties 11 | PostLog.Tests 12 | PostLog.Tests 13 | v3.5 14 | 512 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\..\lib\FakeItEasy.dll 37 | 38 | 39 | ..\..\lib\log4net.dll 40 | 41 | 42 | ..\..\lib\nunit.framework.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE} 62 | PostLog 63 | 64 | 65 | 66 | 73 | -------------------------------------------------------------------------------- /src/PostLog/HttpAppender.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Net; 5 | using System.Text; 6 | using log4net.Appender; 7 | using log4net.Core; 8 | 9 | namespace PostLog 10 | { 11 | public class HttpAppender : AppenderSkeleton 12 | { 13 | private readonly List _parameters; 14 | private IBodyFormatter _formatter; 15 | 16 | public HttpAppender() 17 | { 18 | _parameters = new List(); 19 | 20 | Method = "POST"; 21 | UserAgent = "HttpAppender"; 22 | } 23 | 24 | public string Method { get; set; } 25 | public string UserAgent { get; set; } 26 | public string Uri { get; set; } 27 | public string FormatterType { get; set; } 28 | public string UserId { get; set; } 29 | public string Password { get; set; } 30 | 31 | private IBodyFormatter BodyFormatter 32 | { 33 | get { return _formatter ?? (_formatter = ConstructFormatter(FormatterType)); } 34 | } 35 | 36 | public IBodyFormatter ConstructFormatter(string formatterType) 37 | { 38 | Type type = Type.GetType(formatterType, true); 39 | return (IBodyFormatter)Activator.CreateInstance(type); 40 | } 41 | 42 | 43 | public void AddParameter(HttpAppenderAttribute item) 44 | { 45 | _parameters.Add(item); 46 | } 47 | 48 | protected override void Append(LoggingEvent loggingEvent) 49 | { 50 | byte[] bodyBytes; 51 | 52 | try 53 | { 54 | string body = BodyFormatter.CreateBody(loggingEvent, _parameters); 55 | bodyBytes = Encoding.UTF8.GetBytes(body); 56 | } 57 | catch (Exception e) 58 | { 59 | ErrorHandler.Error("Failed to create body", e); 60 | return; 61 | } 62 | 63 | HttpWebRequest request = BuildRequest(); 64 | 65 | request.BeginGetRequestStream(r => 66 | { 67 | 68 | try 69 | { 70 | using (Stream stream = request.EndGetRequestStream(r)) 71 | { 72 | stream.BeginWrite(bodyBytes, 0, bodyBytes.Length, c => 73 | { 74 | try 75 | { 76 | stream.EndWrite(c); 77 | request.BeginGetResponse(a => 78 | { 79 | try 80 | { 81 | var response = request.EndGetResponse(a); 82 | if (((HttpWebResponse)response).StatusCode != HttpStatusCode.OK) 83 | ErrorHandler.Error("Got failed response: " + ((HttpWebResponse)response).StatusDescription); 84 | response.Close(); 85 | } 86 | catch (Exception e) 87 | { 88 | ErrorHandler.Error("Failed to get response", e); 89 | } 90 | }, null); 91 | } 92 | catch (Exception e) 93 | { 94 | ErrorHandler.Error("Failed to write", e); 95 | } 96 | }, null); 97 | } 98 | 99 | } 100 | catch (Exception e) 101 | { 102 | 103 | ErrorHandler.Error("Failed to connect", e); 104 | } 105 | }, null); 106 | } 107 | 108 | private HttpWebRequest BuildRequest() 109 | { 110 | var request = (HttpWebRequest)WebRequest.Create(Uri); 111 | request.Method = Method; 112 | request.UserAgent = UserAgent; 113 | request.ContentType = BodyFormatter.ContentType; 114 | 115 | if (UserId != null && Password != null) 116 | { 117 | request.Credentials = new NetworkCredential(UserId, Password); 118 | } 119 | 120 | return request; 121 | } 122 | } 123 | } -------------------------------------------------------------------------------- /src/PostLog/PostLog.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {A02B3BCD-DE8D-4A41-8771-8F6E010A1ECE} 9 | Library 10 | Properties 11 | PostLog 12 | PostLog 13 | v3.5 14 | 15 | 16 | 512 17 | 18 | 19 | x86 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | true 42 | bin\Debug\ 43 | DEBUG;TRACE 44 | full 45 | AnyCPU 46 | bin\Debug\PostLog.dll.CodeAnalysisLog.xml 47 | true 48 | GlobalSuppressions.cs 49 | prompt 50 | MinimumRecommendedRules.ruleset 51 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 52 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 53 | 54 | 55 | bin\Release\ 56 | TRACE 57 | true 58 | pdbonly 59 | AnyCPU 60 | bin\Release\PostLog.dll.CodeAnalysisLog.xml 61 | true 62 | GlobalSuppressions.cs 63 | prompt 64 | MinimumRecommendedRules.ruleset 65 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 66 | true 67 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 68 | true 69 | 70 | 71 | 72 | ..\..\lib\log4net.dll 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 99 | -------------------------------------------------------------------------------- /lib/FakeItEasy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FakeItEasy 5 | 6 | 7 | 8 | 9 | Provides methods for generating fake objects. 10 | 11 | 12 | 13 | 14 | Creates a fake object of the type T. 15 | 16 | The type of fake object to create. 17 | A fake object. 18 | 19 | 20 | 21 | Creates a fake object of the type T. 22 | 23 | The type of fake object to create. 24 | A lambda where options for the built fake object cna be specified. 25 | A fake object. 26 | 27 | 28 | 29 | Creates a collection of fakes of the specified type. 30 | 31 | The type of fakes to create. 32 | The number of fakes in the collection. 33 | A collection of fake objects of the specified type. 34 | 35 | 36 | 37 | Gets a dummy object of the specified type. The value of a dummy object 38 | should be irrelevant. Dummy objects should not be configured. 39 | 40 | The type of dummy to return. 41 | A dummy object of the specified type. 42 | Dummies of the specified type can not be created. 43 | 44 | 45 | 46 | Gets a value indicating if the two objects are equal. 47 | 48 | The first object to compare. 49 | The second object to compare. 50 | True if the two objects are equal. 51 | 52 | 53 | 54 | Gets a value indicating if the two objects are the same reference. 55 | 56 | The obj A. 57 | The obj B. 58 | True if the objects are the same reference. 59 | 60 | 61 | 62 | Configures a call to a faked object. 63 | 64 | An expression where the configured memeber is called. 65 | A configuration object. 66 | 67 | 68 | 69 | Configures a call to a faked object. 70 | 71 | The type of member on the faked object to configure. 72 | An expression where the configured memeber is called. 73 | A configuration object. 74 | 75 | 76 | 77 | Provides an api entry point for validating arguments of fake object calls. 78 | 79 | The type of argument to validate. 80 | 81 | 82 | 83 | Gets an argument validations object that provides validations for the argument. 84 | 85 | 86 | 87 | 88 | Returns a constraint that considers any value of an argument as valid. 89 | 90 | 91 | 92 | 93 | Provides configuration for any (not a specific) call on a faked object. 94 | 95 | 96 | 97 | 98 | Gets a configuration object allowing for further configuration of 99 | any calll to the specified faked object. 100 | 101 | The type of fake object. 102 | The faked object to configure. 103 | A configuration object. 104 | 105 | 106 | 107 | Gets a value indicating if the two objects are equal. 108 | 109 | The first object to compare. 110 | The second object to compare. 111 | True if the two objects are equal. 112 | 113 | 114 | 115 | Gets a value indicating if the two objects are the same reference. 116 | 117 | The obj A. 118 | The obj B. 119 | True if the objects are the same reference. 120 | 121 | 122 | 123 | Configuration for any call to a faked object. 124 | 125 | 126 | 127 | 128 | Provides configuration methods for methods that does not have a return value. 129 | 130 | 131 | 132 | 133 | Configuration that lets the developer specify that an exception should be 134 | thrown by a fake object call. 135 | 136 | 137 | 138 | 139 | Hides standard Object members to make fluent interfaces 140 | easier to read. Found in the source of Autofac: http://code.google.com/p/autofac/ 141 | Based on blog post by @kzu here: 142 | http://www.clariusconsulting.net/blogs/kzu/archive/2008/03/10/58301.aspx 143 | 144 | 145 | 146 | 147 | Hides the ToString-method. 148 | 149 | A string representation of the implementing object. 150 | 151 | 152 | 153 | Determines whether the specified is equal to this instance. 154 | 155 | The to compare with this instance. 156 | 157 | true if the specified is equal to this instance; otherwise, false. 158 | 159 | 160 | 161 | 162 | Returns a hash code for this instance. 163 | 164 | 165 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 166 | 167 | 168 | 169 | 170 | Gets the type. 171 | 172 | 173 | 174 | 175 | 176 | Throws the specified exception when the currently configured 177 | call gets called. 178 | 179 | The exception to throw. 180 | Configuration object. 181 | 182 | 183 | 184 | Configuration for callbacks of fake object calls. 185 | 186 | The type of interface to return. 187 | 188 | 189 | 190 | Executes the specified action when a matching call is being made. 191 | 192 | The action to invoke. 193 | A configuration object. 194 | 195 | 196 | 197 | Configuration that lets you specify that a fake object call should call it's base method. 198 | 199 | 200 | 201 | 202 | When the configured method or methods are called the call 203 | will be delegated to the base method of the faked method. 204 | 205 | A configuration object. 206 | The fake object is of an abstract type or an interface 207 | and no base method exists. 208 | 209 | 210 | 211 | Lets the developer configure output values of out and ref parameters. 212 | 213 | 214 | 215 | 216 | Specifies output values for out and ref parameters. Specify the values in the order 217 | the ref and out parameters has in the configured call, any non out and ref parameters are ignored. 218 | 219 | The values. 220 | A configuration object. 221 | 222 | 223 | 224 | Allows the developer to assert on a call that's configured. 225 | 226 | 227 | 228 | 229 | Asserts that the configured call has happened the number of times 230 | constrained by the repeatConstraint parameter. 231 | 232 | A constraint for how many times the call 233 | must have happened. 234 | The call has not been called a number of times 235 | that passes the repeat constraint. 236 | 237 | 238 | 239 | Configures the specified call to do nothing when called. 240 | 241 | A configuration object. 242 | 243 | 244 | 245 | Matches calls that has the return type specified in the generic type parameter. 246 | 247 | The return type of the members to configure. 248 | A configuration object. 249 | 250 | 251 | 252 | Access all types in all assemblies in the same directory as the FakeItEasy dll. 253 | 254 | 255 | 256 | 257 | Provides a set of types that are available. 258 | 259 | 260 | 261 | 262 | Gets a collection of available types. 263 | 264 | The available types. 265 | 266 | 267 | 268 | Initializes a new instance of the class. 269 | 270 | 271 | 272 | 273 | Gets a collection of available types. 274 | 275 | The available types. 276 | 277 | 278 | 279 | Default implementation ofthe IFakeCreator-interface. 280 | 281 | 282 | 283 | 284 | A facade used by the public api for testability. 285 | 286 | 287 | 288 | 289 | Creates a fake object of the specified type. 290 | 291 | The type of fake to create. 292 | Options for the created fake object. 293 | The created fake object. 294 | Was unable to generate the fake in the current configuration. 295 | 296 | 297 | 298 | Creates a dummy object, this can be a fake object or an object resolved 299 | from the current IFakeObjectContainer. 300 | 301 | The type of dummy to create. 302 | The created dummy. 303 | Was unable to generate the fake in the current configuration and 304 | no dummy was registered in the container for the specifed type.. 305 | 306 | 307 | 308 | Creates a collection of fakes of the specified type. 309 | 310 | The type of fakes to create. 311 | The number of fakes in the collection. 312 | A collection of fake objects of the specified type. 313 | 314 | 315 | 316 | Initializes a new instance of the class. 317 | 318 | The fake and dummy manager. 319 | 320 | 321 | 322 | Creates a fake object of the specified type. 323 | 324 | The type of fake to create. 325 | Options for the created fake object. 326 | The created fake object. 327 | Was unable to generate the fake in the current configuration. 328 | 329 | 330 | 331 | Creates a collection of fakes of the specified type. 332 | 333 | The type of fakes to create. 334 | The number of fakes in the collection. 335 | 336 | A collection of fake objects of the specified type. 337 | 338 | 339 | 340 | 341 | Creates a dummy object, this can be a fake object or an object resolved 342 | from the current IFakeObjectContainer. 343 | 344 | The type of dummy to create. 345 | The created dummy. 346 | Was unable to generate the fake in the current configuration and 347 | no dummy was registered in the container for the specifed type.. 348 | 349 | 350 | 351 | Provides options for fake wrappers. 352 | 353 | The type of the fake object generated. 354 | 355 | 356 | 357 | Provides options for generating fake object. 358 | 359 | The type of fake object generated. 360 | 361 | 362 | 363 | Specifies arguments for the constructor of the faked class. 364 | 365 | The arguments to pass to the consturctor of the faked class. 366 | Options object. 367 | 368 | 369 | 370 | Specifies arguments for the constructor of the faked class by giving an expression with the call to 371 | the desired constructor using the arguments to be passed to the constructor. 372 | 373 | The constructor call to use when creating a class proxy. 374 | Options object. 375 | 376 | 377 | 378 | Specifies that the fake should delegate calls to the specified instance. 379 | 380 | The object to delegate calls to. 381 | Options object. 382 | 383 | 384 | 385 | Sets up the fake to implement the specified interface in addition to the 386 | originally faked class. 387 | 388 | The type of interface to implement. 389 | Options object. 390 | The specified type is not an interface. 391 | The specified type is null. 392 | 393 | 394 | 395 | Specifies a fake recorder to use. 396 | 397 | The recorder to use. 398 | Options object. 399 | 400 | 401 | 402 | Handles configuring of fake objects to delegate all their calls to a wrapped instance. 403 | 404 | 405 | 406 | 407 | Manages configuration of fake objects to wrap instances. 408 | 409 | 410 | 411 | 412 | Configures the specified faked object to wrap the specified instance. 413 | 414 | The faked object to configure. 415 | The instance to wrap. 416 | The recorder to use, null if no recording should be made. 417 | 418 | 419 | 420 | Configures the specified faked object to wrap the specified instance. 421 | 422 | The faked object to configure. 423 | The instance to wrap. 424 | The recorder to use, null if no recording should be made. 425 | 426 | 427 | 428 | Provides the base implementation for the IFakeConfigurator-interface. 429 | 430 | The type of fakes the configurator can configure. 431 | 432 | 433 | 434 | Provides configurations for fake objects of a specific type. 435 | 436 | 437 | 438 | 439 | Applies the configuration for the specified fake object. 440 | 441 | The fake object to configure. 442 | 443 | 444 | 445 | The type the instance provides configuration for. 446 | 447 | 448 | 449 | 450 | Applies the configuration for the specified fake object. 451 | 452 | The fake object to configure. 453 | 454 | 455 | 456 | Asserts the type of the that fake is of correct. 457 | 458 | The fake object. 459 | 460 | 461 | 462 | Configures the fake. 463 | 464 | The fake object. 465 | 466 | 467 | 468 | The type the instance provides configuration for. 469 | 470 | 471 | 472 | 473 | 474 | Represents a definition of how a fake object of the type T should 475 | be created. 476 | 477 | The type of fake. 478 | 479 | 480 | 481 | Represents a definition of how dummies of the specified type should be created. 482 | 483 | 484 | 485 | 486 | Creates the fake. 487 | 488 | The fake object. 489 | 490 | 491 | 492 | The type of fake object the definition is for. 493 | 494 | 495 | 496 | 497 | Creates the fake. 498 | 499 | The fake object. 500 | 501 | 502 | 503 | Creates the fake. 504 | 505 | The fake object. 506 | 507 | 508 | 509 | Gets the type the definition is for. 510 | 511 | For type. 512 | 513 | 514 | 515 | Handles the creation of a IProxyGenerator instance. 516 | 517 | 518 | 519 | 520 | When implemented creates a new IProxyGenerator-instance. 521 | 522 | The IFakeObjectContainer provided by the FakeItEasy framework. 523 | A new IProxyGenerator. 524 | 525 | 526 | 527 | A fake object container where delegates can be registered that are used to 528 | resolve fake objects. 529 | 530 | 531 | 532 | 533 | A container that can create fake objects. 534 | 535 | 536 | 537 | 538 | Creates a fake object of the specified type using the specified arguments if it's 539 | supported by the container, returns a value indicating if it's supported or not. 540 | 541 | The type of fake object to create. 542 | The fake object that was created if the method returns true. 543 | True if a fake object can be created. 544 | 545 | 546 | 547 | Applies base configuration to a fake object. 548 | 549 | The type the fake object represents. 550 | The fake object to configure. 551 | 552 | 553 | 554 | Creates a new instance of the DelegateFakeObjectContainer. 555 | 556 | 557 | 558 | 559 | Creates a fake object of the specified type using the specified arguments if it's 560 | supported by the container, returns a value indicating if it's supported or not. 561 | 562 | The type of fake object to create. 563 | The fake object that was created if the method returns true. 564 | True if a fake object can be created. 565 | 566 | 567 | 568 | Registers the specified fake delegate. 569 | 570 | 571 | The fake delegate. 572 | 573 | 574 | 575 | Configures the fake. 576 | 577 | The type of fake. 578 | The fake object. 579 | 580 | 581 | 582 | An exception that is thrown when there was an error creating a fake object. 583 | 584 | 585 | 586 | 587 | Initializes a new instance of the class. 588 | 589 | 590 | 591 | 592 | Initializes a new instance of the class. 593 | 594 | The message. 595 | 596 | 597 | 598 | Initializes a new instance of the class. 599 | 600 | The message. 601 | The inner exception. 602 | 603 | 604 | 605 | Initializes a new instance of the class. 606 | 607 | The that holds the serialized object data about the exception being thrown. 608 | The that contains contextual information about the source or destination. 609 | 610 | The parameter is null. 611 | 612 | 613 | The class name is null or is zero (0). 614 | 615 | 616 | 617 | 618 | The default implementation of the IFakeAndDummyManager interface. 619 | 620 | 621 | 622 | 623 | Handles the creation of fake and dummy objects. 624 | 625 | 626 | 627 | 628 | Creates a dummy of the specified type. 629 | 630 | The type of dummy to create. 631 | The created dummy. 632 | The current IProxyGenerator is not able to generate a fake of the specified type and 633 | the current IFakeObjectContainer does not contain the specified type. 634 | 635 | 636 | 637 | Creates a fake object of the specified type. 638 | 639 | The type of fake object to generate. 640 | Options for building the fake object. 641 | A fake object. 642 | The current IProxyGenerator is not able to generate a fake of the specified type. 643 | 644 | 645 | 646 | Tries to create a dummy of the specified type. 647 | 648 | The type of dummy to create. 649 | Outputs the result dummy when creation is successful. 650 | A value indicating whether the creation was successful. 651 | 652 | 653 | 654 | Tries to create a fake object of the specified type. 655 | 656 | The type of fake to create. 657 | Options for the creation of the fake. 658 | The created fake object when creation is successful. 659 | A value indicating whether the creation was successful. 660 | 661 | 662 | 663 | Initializes a new instance of the class. 664 | 665 | The container. 666 | The proxy generator. 667 | The fake object factory. 668 | The wrapper configurator to use. 669 | 670 | 671 | 672 | Creates a dummy of the specified type. 673 | 674 | The type of dummy to create. 675 | The created dummy. 676 | The current IProxyGenerator is not able to generate a fake of the specified type and 677 | the current IFakeObjectContainer does not contain the specified type. 678 | 679 | 680 | 681 | Creates a fake object of the specified type. 682 | 683 | The type of fake object to generate. 684 | Options for building the fake object. 685 | A fake object. 686 | The current IProxyGenerator is not able to generate a fake of the specified type. 687 | 688 | 689 | 690 | Tries to create a dummy of the specified type. 691 | 692 | The type of dummy to create. 693 | Outputs the result dummy when creation is successful. 694 | 695 | A value indicating whether the creation was successful. 696 | 697 | 698 | 699 | 700 | Tries to create a fake object of the specified type. 701 | 702 | The type of fake to create. 703 | Options for the creation of the fake. 704 | The created fake object when creation is successful. 705 | 706 | A value indicating whether the creation was successful. 707 | 708 | 709 | 710 | 711 | Creates a proxy of the specified type. 712 | 713 | The type of proxy. 714 | Any to implement additional to the specified type of proxy. 715 | The arguments for constructor. 716 | if set to true an exception is thrown when the proxy generator 717 | can not generate a proxy of the specified type. 718 | A proxy. 719 | 720 | 721 | 722 | Provides access to a set of calls and a call matcher for these calls. 723 | 724 | 725 | 726 | 727 | A set of calls. 728 | 729 | 730 | 731 | 732 | A matcher used to select among the calls. 733 | 734 | 735 | 736 | 737 | Represents a predicate that matches a fake object call. 738 | 739 | 740 | 741 | 742 | Gets a value indicating whether the call matches the predicate. 743 | 744 | The call to match. 745 | True if the call matches the predicate. 746 | 747 | 748 | 749 | Provides validation extension to the Argumentscope{T} class. 750 | 751 | 752 | 753 | 754 | Validates that an argument is null. 755 | 756 | The type of the argument. 757 | The scope of the constraint. 758 | An argument constraint. 759 | 760 | 761 | 762 | Validates that the string argument contains the specified text. 763 | 764 | The scope of the constraint. 765 | The string the argument string should contain. 766 | An argument constraint. 767 | 768 | 769 | 770 | Validates that the collection argument contains the specified value. 771 | 772 | The scope of the constraint. 773 | The value the collection should contain. 774 | An argument constraint. 775 | 776 | 777 | 778 | Validates that the string argument starts with the specified text. 779 | 780 | The scope of the constraint. 781 | The string the argument string should start with. 782 | An argument constraint. 783 | 784 | 785 | 786 | Validates that the string argument is null or the empty string. 787 | 788 | The scope of the constraint. 789 | An argument constraint. 790 | 791 | 792 | 793 | Validates that the argument is greater than the specified value. 794 | 795 | The type of the argument. 796 | The scope of the constraint. 797 | The value that the argument has to be greatere than. 798 | An argument constraint. 799 | 800 | 801 | 802 | Provides the base for rules that can be built using the FakeConfiguration. 803 | 804 | 805 | 806 | 807 | Allows for intercepting call to a fake object and 808 | act upon them. 809 | 810 | 811 | 812 | 813 | Gets wether this interceptor is applicable to the specified 814 | call, if true is returned the Apply-method of the interceptor will 815 | be called. 816 | 817 | The call to check for applicability. 818 | True if the interceptor is applicable. 819 | 820 | 821 | 822 | Applies an action to the call, might set a return value or throw 823 | an exception. 824 | 825 | The call to apply the interceptor to. 826 | 827 | 828 | 829 | Gets the number of times this call rule is valid, if it's set 830 | to null its infinitely valid. 831 | 832 | 833 | 834 | 835 | Gets if this rule is applicable to the specified call. 836 | 837 | The call to validate. 838 | True if the rule applies to the call. 839 | 840 | 841 | 842 | An action that is called by the Apply method to apply this 843 | rule to a fake object call. 844 | 845 | 846 | 847 | 848 | A collection of actions that should be invoked when the configured 849 | call is made. 850 | 851 | 852 | 853 | 854 | The number of times the configured rule should be used. 855 | 856 | 857 | 858 | 859 | Values to apply to output and reference variables. 860 | 861 | 862 | 863 | 864 | Gets or sets wether the base mehtod of the fake object call should be 865 | called when the fake object call is made. 866 | 867 | 868 | 869 | 870 | Manages registration of a set of components in a DictionaryContainer. 871 | 872 | 873 | 874 | 875 | Registers the components of this module. 876 | 877 | The container to register components in. 878 | 879 | 880 | 881 | A factory that creates instances of the RecordingCallRuleType. 882 | 883 | 884 | 885 | 886 | Creates the specified fake object. 887 | 888 | The type of the fake. 889 | The fake object the rule belongs to. 890 | The rule that's being recorded. 891 | A RecordingCallRule instance. 892 | 893 | 894 | 895 | A factory responsible for creating start configuration for fake objects. 896 | 897 | 898 | 899 | 900 | Creates a start configuration for the specified fake object that fakes the 901 | specified type. 902 | 903 | The type of the fake object. 904 | The fake object to configure. 905 | A configuration object. 906 | 907 | 908 | 909 | An exception that can be thrown when something goes wrong with the configuration 910 | of a fake object. 911 | 912 | 913 | 914 | 915 | Initializes a new instance of the class. 916 | 917 | 918 | 919 | 920 | Initializes a new instance of the class. 921 | 922 | The message. 923 | 924 | 925 | 926 | Initializes a new instance of the class. 927 | 928 | The message. 929 | The inner exception. 930 | 931 | 932 | 933 | Initializes a new instance of the class. 934 | 935 | The that holds the serialized object data about the exception being thrown. 936 | The that contains contextual information about the source or destination. 937 | 938 | The parameter is null. 939 | 940 | 941 | The class name is null or is zero (0). 942 | 943 | 944 | 945 | 946 | Handles the configuration of fake object given an expression specifying 947 | a call on a faked object. 948 | 949 | 950 | 951 | 952 | Provides methods for configuring a fake object. 953 | 954 | The type of fake object. 955 | 956 | 957 | 958 | Configures the behavior of the fake object when a call that matches the specified 959 | call happens. 960 | 961 | The type of the return value of the member. 962 | An expression that specifies the calls to configure. 963 | A configuration object. 964 | 965 | 966 | 967 | Configures the behavior of the fake object when a call that matches the specified 968 | call happens. 969 | 970 | An expression that specifies the calls to configure. 971 | A configuration object. 972 | 973 | 974 | 975 | Configures the behavior of the fake object whan a call is made to any method on the 976 | object. 977 | 978 | A configuration object. 979 | 980 | 981 | 982 | A IFakeObjectContainer implementation that uses mef to load IFakeDefinitions and 983 | IFakeConfigurations. 984 | 985 | 986 | 987 | 988 | Initializes a new instance of the class. 989 | 990 | 991 | 992 | 993 | Creates a fake object of the specified type using the specified arguments if it's 994 | supported by the container, returns a value indicating if it's supported or not. 995 | 996 | The type of fake object to create. 997 | The fake object that was created if the method returns true. 998 | True if a fake object can be created. 999 | 1000 | 1001 | 1002 | Applies base configuration to a fake object. 1003 | 1004 | The type the fake object represents. 1005 | The fake object to configure. 1006 | 1007 | 1008 | 1009 | Represents a call to a fake object at interception time. 1010 | 1011 | 1012 | 1013 | 1014 | Represents a fake object call that can be edited. 1015 | 1016 | 1017 | 1018 | 1019 | Represents a call to a fake object. 1020 | 1021 | 1022 | 1023 | 1024 | The method that's called. 1025 | 1026 | 1027 | 1028 | 1029 | The arguments used in the call. 1030 | 1031 | 1032 | 1033 | 1034 | The faked object the call is performed on. 1035 | 1036 | 1037 | 1038 | 1039 | Sets the return value of the call. 1040 | 1041 | The return value to set. 1042 | 1043 | 1044 | 1045 | Calls the base method of the faked type. 1046 | 1047 | 1048 | 1049 | 1050 | Sets the value of the argument at the specified index in the parameters list. 1051 | 1052 | The index of the argument to set the value of. 1053 | The value to set to the argument. 1054 | 1055 | 1056 | 1057 | Freezes the call so that it can no longer be modified. 1058 | 1059 | A completed fake object call. 1060 | 1061 | 1062 | 1063 | Sets that the call should not be recorded by the fake manager. 1064 | 1065 | 1066 | 1067 | 1068 | A strongly-typed resource class, for looking up localized strings, etc. 1069 | 1070 | 1071 | 1072 | 1073 | Returns the cached ResourceManager instance used by this class. 1074 | 1075 | 1076 | 1077 | 1078 | Overrides the current thread's CurrentUICulture property for all 1079 | resource lookups using this strongly typed resource class. 1080 | 1081 | 1082 | 1083 | 1084 | Looks up a localized string similar to The Apply method of the ExpressionInterceptor may no be called before the Applicator property has been set.. 1085 | 1086 | 1087 | 1088 | 1089 | Looks up a localized string similar to The specified argument name does not exist in the ArgumentList.. 1090 | 1091 | 1092 | 1093 | 1094 | Looks up a localized string similar to Arguments for constructor was specified when generating proxy of interface type.. 1095 | 1096 | 1097 | 1098 | 1099 | Looks up a localized string similar to An argument validation was not configured correctly.. 1100 | 1101 | 1102 | 1103 | 1104 | Looks up a localized string similar to The method '{0}' was called too few times, expected #{1} times but was called #{2} times.. 1105 | 1106 | 1107 | 1108 | 1109 | Looks up a localized string similar to The method '{0}' was called too many times, expected #{1} times but was called #{2} times.. 1110 | 1111 | 1112 | 1113 | 1114 | Looks up a localized string similar to Can not create fake of the type '{0}', it's not registered in the current container and the current IProxyGenerator can not generate the fake.. 1115 | 1116 | 1117 | 1118 | 1119 | Looks up a localized string similar to Error when accessing FakeObject, the specified argument is of the type '{0}' which is not faked.. 1120 | 1121 | 1122 | 1123 | 1124 | Looks up a localized string similar to An ExpressionCallMatcher can only be created for expressions that represents a method call or a property getter.. 1125 | 1126 | 1127 | 1128 | 1129 | Looks up a localized string similar to FakeItEasy failed to create fake object of type "{0}". 1130 | 1131 | 1. The type is not registered in the current IFakeObjectContainer. 1132 | 2. The current IProxyGenerator failed to generate a proxy for the following reason: {1}. 1133 | 1134 | 1135 | 1136 | 1137 | Looks up a localized string similar to Unable to create fake object.. 1138 | 1139 | 1140 | 1141 | 1142 | Looks up a localized string similar to Only abstract classes can be faked using the A.Fake-method that takes an enumerable of objects as arguments for constructor, use the overload that takes an expression instead.. 1143 | 1144 | 1145 | 1146 | 1147 | Looks up a localized string similar to The member accessor expression must be a lambda expression with a MethodCallExpression or MemberAccessExpression as its body.. 1148 | 1149 | 1150 | 1151 | 1152 | Looks up a localized string similar to The specified method can not be configured since it can not be intercepted by the current IProxyGenerator.. 1153 | 1154 | 1155 | 1156 | 1157 | Looks up a localized string similar to The method of the call did not match the method of the recorded call, the recorded sequence is no longer valid.. 1158 | 1159 | 1160 | 1161 | 1162 | Looks up a localized string similar to No constructor matching the specified arguments was found on the type {0}.. 1163 | 1164 | 1165 | 1166 | 1167 | Looks up a localized string similar to Can not generate fake object for the class since no default constructor was found, specify a constructor call.. 1168 | 1169 | 1170 | 1171 | 1172 | Looks up a localized string similar to All the recorded calls has been applied, the recorded sequence is no longer valid.. 1173 | 1174 | 1175 | 1176 | 1177 | Looks up a localized string similar to Only expression of the type ExpressionType.New (constructor calls) are accepted.. 1178 | 1179 | 1180 | 1181 | 1182 | Looks up a localized string similar to The Now-method on the event raise is not meant to be called directly, only use it to register to an event on a fake object that you want to be raised.. 1183 | 1184 | 1185 | 1186 | 1187 | Looks up a localized string similar to The number of values for out and ref parameters specified does not match the number of out and ref parameters in the call.. 1188 | 1189 | 1190 | 1191 | 1192 | Looks up a localized string similar to The current fake proxy generator can not create proxies of the type {0}.. 1193 | 1194 | 1195 | 1196 | 1197 | Looks up a localized string similar to Expected to find call {0} the number of times specified by the predicate '{1}' but found it {2} times among the calls:. 1198 | 1199 | 1200 | 1201 | 1202 | Looks up a localized string similar to The number of argument names does not match the number of arguments.. 1203 | 1204 | 1205 | 1206 | 1207 | Represents a scope for arguments constraints when they're chained together, enables the logical operators 1208 | and and not. 1209 | 1210 | The type of argument to constrain. 1211 | 1212 | 1213 | 1214 | Gets an ArgumentConstraint that is valid if the specified predicate returns true. 1215 | 1216 | A predicate that validates the argument. 1217 | An ArgumentConstraint. 1218 | 1219 | 1220 | 1221 | Gets an argumentConstraint that validates that the argument is 1222 | of the specified type or any derivative. 1223 | 1224 | The type to check for. 1225 | An argument constraint. 1226 | 1227 | 1228 | 1229 | The base implementation returns the empty string. 1230 | 1231 | Empty string. 1232 | 1233 | 1234 | 1235 | Gets a value indicating if the argument is valid in the context 1236 | of this ArgumentValidations-object. 1237 | 1238 | The argument to validate. 1239 | True if the argument is valid. 1240 | 1241 | 1242 | 1243 | Gets a value indicating if the result of a child constraints IsValid-call 1244 | is valid in the context of this ArgumentValidations. 1245 | 1246 | The result of the call to the child constraints IsValid-method. 1247 | True if the result is valid. 1248 | 1249 | 1250 | 1251 | Reverse the is valid of the constraint that comes after the not, so that 1252 | if the constraint is valid the result is false and if the constraint is not 1253 | valid the result is true. 1254 | 1255 | 1256 | 1257 | 1258 | Provides static methods for the ArgumentConstraint{T} class. 1259 | 1260 | 1261 | 1262 | 1263 | Creates a new constraint. 1264 | 1265 | The scope of the constraint. 1266 | A predicate that's used to validate arguments. 1267 | A description of the constraint. 1268 | An ArgumentConstraint. 1269 | 1270 | 1271 | 1272 | Allows you to combine the current constraint with another constraint, where only 1273 | one of them has to be valid. 1274 | 1275 | The constraint to extend. 1276 | A delegate that returns the constraint to combine with. 1277 | A combined constraint. 1278 | 1279 | 1280 | 1281 | An object that can determine if an argument of the type T is valid or not. 1282 | 1283 | The type of argument to validate. 1284 | 1285 | 1286 | 1287 | Validates an argument, checks that it's valid in a specific fake call. 1288 | 1289 | 1290 | 1291 | 1292 | Gets whether the argument is valid. 1293 | 1294 | The argument to validate. 1295 | True if the argument is valid. 1296 | 1297 | 1298 | 1299 | Initializes a new instance of the class. 1300 | 1301 | The scope of the constraint. 1302 | 1303 | 1304 | 1305 | Converts a constraint to the the type of the constrained argument. 1306 | 1307 | 1308 | 1309 | 1310 | 1311 | 1312 | Converts an argument to an ArgumentConstraint that evaluates equality. 1313 | 1314 | The argument to convert. 1315 | An equality constraint. 1316 | 1317 | 1318 | 1319 | Allows you to combine the current constraint with another constraint, where only 1320 | one of them has to be valid. 1321 | 1322 | The constraint to combine with. 1323 | A combined constraint. 1324 | 1325 | 1326 | 1327 | Gets a value indicating if the value is valid. 1328 | 1329 | The value to evaluate. 1330 | True if the value is valid. 1331 | 1332 | 1333 | 1334 | Gets a formatted description of this constraint. 1335 | 1336 | A description of this constraint. 1337 | 1338 | 1339 | 1340 | Gets whether the argument is valid. 1341 | 1342 | The argument to validate. 1343 | True if the argument is valid. 1344 | 1345 | 1346 | 1347 | When implemented evaluates if the argument is valid. 1348 | 1349 | The value to evaluate. 1350 | True if the argument is valid. 1351 | 1352 | 1353 | 1354 | A constraint for an interface type can not be implicitly converted to the 1355 | argument type, use this property in these cases. 1356 | 1357 | 1358 | A.CallTo(() => foo.Bar(A<string>Ignored, A<IComparable%gt;.Ignored.Argument)).Throws(new Exception()); 1359 | 1360 | 1361 | 1362 | 1363 | Produces a new scope to combine the current constraint with another constraint. 1364 | 1365 | 1366 | 1367 | 1368 | The scope of the constraint. 1369 | 1370 | 1371 | 1372 | 1373 | Gets the full description of the constraint, together with any parent validations 1374 | and constraints descriptions. 1375 | 1376 | 1377 | 1378 | 1379 | Gets a description of this constraint. 1380 | 1381 | 1382 | 1383 | 1384 | Manages breaking call specification expression into their various parts. 1385 | 1386 | 1387 | 1388 | 1389 | Manages breaking call specification expression into their various parts. 1390 | 1391 | 1392 | 1393 | 1394 | Gets the fake object an expression is called on. 1395 | 1396 | The call expression. 1397 | A FakeObject. 1398 | The fakeObjectCall is null. 1399 | The specified expression is not an expression where a call is made to a faked object. 1400 | 1401 | 1402 | 1403 | Gets the fake object an expression is called on. 1404 | 1405 | The call expression. 1406 | A FakeObject. 1407 | The fakeObjectCall is null. 1408 | The specified expression is not an expression where a call is made to a faked object. 1409 | 1410 | 1411 | 1412 | Provides syntax for specifying the number of times a call must have been repeated when asserting on 1413 | fake object calls. 1414 | 1415 | A.CallTo(() => foo.Bar()).Assert(Happened.Once.Exactly); 1416 | 1417 | 1418 | 1419 | Asserts that a call has happened the specified number of times 1420 | or more. 1421 | 1422 | The number of times the call must have happened. 1423 | A HappenedNoUpperBound instance. 1424 | 1425 | 1426 | 1427 | When implemented gets a value indicating if the repeat is matched 1428 | by the Happened-instance. 1429 | 1430 | The repeat of a call. 1431 | True if the repeat is a match. 1432 | 1433 | 1434 | 1435 | Specifies that a call must have been repeated a number of times 1436 | that is validated by the specified repeatValidation argument. 1437 | 1438 | A predicate that specifies the number of times 1439 | a call must have been made. 1440 | A Repeated-instance. 1441 | 1442 | 1443 | 1444 | Asserts that a call has not happened at all. 1445 | 1446 | 1447 | 1448 | 1449 | Asserts that a call has happened once or more. 1450 | 1451 | 1452 | 1453 | 1454 | Asserts that a call has happend twice or more. 1455 | 1456 | 1457 | 1458 | 1459 | Provides syntax for specifying the number repeat when asserting on 1460 | fake object calls. 1461 | 1462 | 1463 | 1464 | 1465 | Initializes a new instance of the class. 1466 | 1467 | The expected repeat. 1468 | 1469 | 1470 | 1471 | Gets whether the specified repeat is the expected repeat or higher. 1472 | 1473 | The repeat of a call. 1474 | True if the repeat is a match. 1475 | 1476 | 1477 | 1478 | Gets a description of the repeat. 1479 | 1480 | A description of the repeat. 1481 | 1482 | 1483 | 1484 | Restricts the repeat specification so that the call must have 1485 | happened exactly the number of times previously specified, no more 1486 | and no less. 1487 | 1488 | 1489 | 1490 | 1491 | Restricts the repeat specification so that the call must have happened 1492 | no more than the times previously specified. 1493 | 1494 | 1495 | 1496 | 1497 | Provides methods for creating recorders for self initializing fakes. 1498 | 1499 | 1500 | 1501 | 1502 | Gets a recorder that records to and loads calls from the specified file. 1503 | 1504 | The file to use for recording. 1505 | A recorder instance. 1506 | 1507 | 1508 | 1509 | Represents storage for recorded calls for self initializing 1510 | fakes. 1511 | 1512 | 1513 | 1514 | 1515 | Loads the recorded calls for the specified recording. 1516 | 1517 | The recorded calls for the recording with the specified id. 1518 | 1519 | 1520 | 1521 | Saves the specified calls as the recording with the specified id, 1522 | overwriting any previous recording. 1523 | 1524 | The calls to save. 1525 | 1526 | 1527 | 1528 | A factory responsible for creating instances of FileStorage. 1529 | 1530 | The file name of the storage. 1531 | A FileStorage instance. 1532 | 1533 | 1534 | 1535 | Provides access to the file system. 1536 | 1537 | 1538 | 1539 | 1540 | Opens the specified file in the specified mode. 1541 | 1542 | The full path and name of the file to open. 1543 | The mode to open the file in. 1544 | A stream for reading and writing the file. 1545 | 1546 | 1547 | 1548 | Gets a value indicating if the specified file exists. 1549 | 1550 | The path and name of the file to check. 1551 | True if the file exists. 1552 | 1553 | 1554 | 1555 | Creates a file with the specified name. 1556 | 1557 | The name of the file to create. 1558 | 1559 | 1560 | 1561 | An interface for recorders that provides stored responses for self initializing fakes. 1562 | 1563 | 1564 | 1565 | 1566 | Applies the call if the call has been recorded. 1567 | 1568 | The call to apply to from recording. 1569 | 1570 | 1571 | 1572 | Records the specified call. 1573 | 1574 | The call to record. 1575 | 1576 | 1577 | 1578 | Gets a value indicating if the recorder is currently recording. 1579 | 1580 | 1581 | 1582 | 1583 | An exception that can be thrown when recording for self initialized 1584 | fakes fails or when playback fails. 1585 | 1586 | 1587 | 1588 | 1589 | Initializes a new instance of the class. 1590 | 1591 | 1592 | 1593 | 1594 | Initializes a new instance of the class. 1595 | 1596 | The message. 1597 | 1598 | 1599 | 1600 | Initializes a new instance of the class. 1601 | 1602 | The message. 1603 | The inner exception. 1604 | 1605 | 1606 | 1607 | Initializes a new instance of the class. 1608 | 1609 | The that holds the serialized object data about the exception being thrown. 1610 | The that contains contextual information about the source or destination. 1611 | 1612 | The parameter is null. 1613 | 1614 | 1615 | The class name is null or is zero (0). 1616 | 1617 | 1618 | 1619 | 1620 | A call rule use for self initializing fakes, delegates call to 1621 | be applied by the recorder. 1622 | 1623 | 1624 | 1625 | 1626 | Initializes a new instance of the class. 1627 | 1628 | The wrapped rule. 1629 | The recorder. 1630 | 1631 | 1632 | 1633 | Gets wether this interceptor is applicable to the specified 1634 | call, if true is returned the Apply-method of the interceptor will 1635 | be called. 1636 | 1637 | The call to check for applicability. 1638 | True if the interceptor is applicable. 1639 | 1640 | 1641 | 1642 | Applies an action to the call, might set a return value or throw 1643 | an exception. 1644 | 1645 | The call to apply the interceptor to. 1646 | 1647 | 1648 | 1649 | Gets the number of times this call rule is valid, if it's set 1650 | to null its infinitely valid. 1651 | 1652 | 1653 | 1654 | 1655 | 1656 | Represents an event that happens when a call has been intercepted by a proxy. 1657 | 1658 | 1659 | 1660 | 1661 | Initializes a new instance of the class. 1662 | 1663 | The call. 1664 | 1665 | 1666 | 1667 | Gets the call that was intercepted. 1668 | 1669 | The call. 1670 | 1671 | 1672 | 1673 | DTO for recorded calls. 1674 | 1675 | 1676 | 1677 | 1678 | Initializes a new instance of the class. 1679 | 1680 | The method. 1681 | The output arguments. 1682 | The return value. 1683 | 1684 | 1685 | 1686 | Gets the method that was called. 1687 | 1688 | The method. 1689 | 1690 | 1691 | 1692 | Gets the output arguments of the call. 1693 | 1694 | The output arguments. 1695 | 1696 | 1697 | 1698 | Gets the return value of the call. 1699 | 1700 | The return value. 1701 | 1702 | 1703 | 1704 | A combination of the IAfterCallSpecifiedConfiguration and IOutAndRefParametersConfiguration 1705 | interfaces. 1706 | 1707 | 1708 | 1709 | 1710 | Lets you set up expectations and configure repeat for the configured call. 1711 | 1712 | 1713 | 1714 | 1715 | Provides configuration for method calls that has a return value. 1716 | 1717 | 1718 | 1719 | 1720 | Specifies the number of times for the configured event. 1721 | 1722 | The number of times to repeat. 1723 | 1724 | 1725 | 1726 | Provides configurations to validate arguments of a fake object call. 1727 | 1728 | The type of interface to return. 1729 | 1730 | 1731 | 1732 | Configures the call to be accepted when the specified predicate returns true. 1733 | 1734 | The argument predicate. 1735 | A configuration object. 1736 | 1737 | 1738 | 1739 | Configures a call that returns a value and allows the use to 1740 | specify validations for arguments. 1741 | 1742 | The type of the member. 1743 | 1744 | 1745 | 1746 | Configures a call that returns a value. 1747 | 1748 | The type of the member. 1749 | 1750 | 1751 | 1752 | Specifies the value to return when the configured call is made. 1753 | 1754 | The value to return. 1755 | A configuration object. 1756 | 1757 | 1758 | 1759 | Specifies a function used to produce a return value when the configured call is made. 1760 | The function will be called each time this call is made and can return different values 1761 | each time. 1762 | 1763 | A function that produces the return value. 1764 | A configuration object. 1765 | 1766 | 1767 | 1768 | Specifies a function used to produce a return value when the configured call is made. 1769 | The function will be called each time this call is made and can return different values 1770 | each time. 1771 | 1772 | A function that produces the return value. 1773 | A configuration object. 1774 | 1775 | 1776 | 1777 | Provides configuration methods for methods that does not have a return value and 1778 | allows the use to specify validations for arguments. 1779 | 1780 | 1781 | 1782 | 1783 | An implementation of the IProxyGenerator interface that uses DynamicProxy2 to 1784 | generate proxies. 1785 | 1786 | 1787 | 1788 | 1789 | Represents a generator that can generate proxies that emits events when calls are intercepted. 1790 | 1791 | 1792 | 1793 | 1794 | Gets a value indicating if a proxy of the specified type can be generated and sets the generated proxy 1795 | to the out parameter if it can. 1796 | 1797 | The type to generate a proxy for. 1798 | The generated proxy must implement the IFakedProxy interface and this is the fake object 1799 | that should be returned for the call to GetFakeObject(). 1800 | Arguments to use for the constructor of the proxied type. 1801 | Any extra interfaces to be implemented by the generated proxy. 1802 | True if the proxy could be generated. 1803 | The arguments in argumentsForConstructor does not match any constructor 1804 | of the proxied type. 1805 | 1806 | 1807 | 1808 | Gets a value indicating if the specified member can be intercepted on a proxied 1809 | instance. 1810 | 1811 | The member to check. 1812 | True if the member can be intercepted, otherwise false. 1813 | 1814 | 1815 | 1816 | Gets a value indicating if a proxy of the specified type can be generated and sets the generated proxy 1817 | to the out parameter if it can. 1818 | 1819 | The type to generate a proxy for. 1820 | Any extra interfaces to be implemented by the generated proxy. 1821 | The generated proxy must implement the IFakedProxy interface and this is the fake object 1822 | that should be returned for the call to GetFakeObject(). 1823 | Arguments to use for the constructor of the proxied type. 1824 | True if the proxy could be generated. 1825 | The arguments in argumentsForConstructor does not match any constructor 1826 | of the proxied type. 1827 | 1828 | 1829 | 1830 | Gets a value indicating if the specified member can be intercepted on a proxied 1831 | instance. 1832 | 1833 | The member to check. 1834 | 1835 | True if the member can be intercepted, otherwise false. 1836 | 1837 | 1838 | 1839 | 1840 | Represents a result from an IProxyGenerator. 1841 | 1842 | 1843 | 1844 | 1845 | Initializes a new instance of the class. 1846 | 1847 | Type of the proxied. 1848 | 1849 | 1850 | 1851 | Gets the type of the generated proxy. 1852 | 1853 | The type of the generated proxy. 1854 | 1855 | 1856 | 1857 | Gets a value indicating whether the proxy was successfully created. 1858 | 1859 | 1860 | true If proxy was successfully created; otherwise, false. 1861 | 1862 | 1863 | 1864 | 1865 | Gets an error message when the proxy was not successfully created. 1866 | 1867 | The error message. 1868 | 1869 | 1870 | 1871 | Gets the generated proxy when successfully generated. 1872 | 1873 | The generated proxy. 1874 | 1875 | 1876 | 1877 | Occurs when a call to the proxy was intercepted. 1878 | 1879 | 1880 | 1881 | 1882 | An interface implemented by DynamicProxy proxies in order to let them 1883 | intercept object members. 1884 | 1885 | NOT INTENDED FOR USE! Note that this interface WILL be removed from future versions of FakeItEasy. 1886 | 1887 | 1888 | 1889 | 1890 | Returns a that represents this instance. 1891 | 1892 | 1893 | A that represents this instance. 1894 | 1895 | 1896 | 1897 | 1898 | Determines whether the specified is equal to this instance. 1899 | 1900 | The to compare with this instance. 1901 | 1902 | true if the specified is equal to this instance; otherwise, false. 1903 | 1904 | 1905 | 1906 | 1907 | Returns a hash code for this instance. 1908 | 1909 | 1910 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 1911 | 1912 | 1913 | 1914 | 1915 | Handles comparisons of MethodInfos. 1916 | 1917 | 1918 | 1919 | 1920 | Gets a value indicating if the two method infos would invoke the same method 1921 | if invoked on an instance of the target type. 1922 | 1923 | The type of target for invokation. 1924 | The first MethodInfo. 1925 | The second MethodInfo. 1926 | True if the same method would be invoked. 1927 | 1928 | 1929 | 1930 | A simple implementation of an IoC container. 1931 | 1932 | 1933 | 1934 | 1935 | The dictionary that stores the registered services. 1936 | 1937 | 1938 | 1939 | 1940 | Initializes a new instance of the class. 1941 | 1942 | 1943 | 1944 | 1945 | Resolves an instance of the specified component type. 1946 | 1947 | Type of the component. 1948 | An instance of the component type. 1949 | 1950 | 1951 | 1952 | Registers the specified resolver. 1953 | 1954 | The type of component to register. 1955 | The resolver. 1956 | 1957 | 1958 | 1959 | Registers the specified resolver as a singleton. 1960 | 1961 | The type of component to register. 1962 | The resolver. 1963 | 1964 | 1965 | 1966 | Responsible for creating argument constraints from arguments in an expression. 1967 | 1968 | 1969 | 1970 | 1971 | Gets an argument constraint for the argument represented by the expression. 1972 | 1973 | The argument. 1974 | An IArgumentConstraint used to validated arguments in IFakeObjectCalls. 1975 | 1976 | 1977 | 1978 | Keeps track of metadata for interceptions. 1979 | 1980 | 1981 | 1982 | 1983 | Gets whether the rule has been called the number of times specified or not. 1984 | 1985 | True if the rule has not been called the number of times specified. 1986 | 1987 | 1988 | 1989 | Gets or sets the number of times the rule has been used. 1990 | 1991 | 1992 | 1993 | 1994 | Gets or sets the rule this metadata object is tracking. 1995 | 1996 | 1997 | 1998 | 1999 | Handles the matching of fake object calls to expressions. 2000 | 2001 | 2002 | 2003 | 2004 | Initializes a new instance of the class. 2005 | 2006 | The call specification. 2007 | The constraint factory. 2008 | The method infor manager to use. 2009 | 2010 | 2011 | 2012 | Matcheses the specified call against the expression. 2013 | 2014 | The call to match. 2015 | True if the call is matched by the expression. 2016 | 2017 | 2018 | 2019 | Gets a description of the call. 2020 | 2021 | Description of the call. 2022 | 2023 | 2024 | 2025 | A null implementation for the IFakeObjectContainer interface. 2026 | 2027 | 2028 | 2029 | 2030 | Always returns false and sets the fakeObject to null. 2031 | 2032 | The type of fake object to create. 2033 | Output variable for the fake object that will always be set to null. 2034 | Always return false. 2035 | 2036 | 2037 | 2038 | Applies base configuration to a fake object. 2039 | 2040 | The type the fake object represents. 2041 | The fake object to configure. 2042 | 2043 | 2044 | 2045 | The central point in the API for proxied fake objects handles interception 2046 | of fake object calls by using a set of rules. User defined rules can be inserted 2047 | by using the AddRule-method. 2048 | 2049 | 2050 | 2051 | 2052 | Initializes a new instance of the class. 2053 | 2054 | 2055 | 2056 | 2057 | Adds a call rule to the fake object. 2058 | 2059 | The rule to add. 2060 | 2061 | 2062 | 2063 | Adds a call rule last in the list of user rules, meaning it has the lowest priority possible. 2064 | 2065 | The rule to add. 2066 | 2067 | 2068 | 2069 | Removes the specified rule for the fake object. 2070 | 2071 | The rule to remove. 2072 | 2073 | 2074 | 2075 | Gets the faked object. 2076 | 2077 | 2078 | 2079 | 2080 | Gets the faked type. 2081 | 2082 | 2083 | 2084 | 2085 | Gets the interceptions that are currently registered with the fake object. 2086 | 2087 | 2088 | 2089 | 2090 | Gets a collection of all the calls made to the fake object within the current scope. 2091 | 2092 | 2093 | 2094 | 2095 | A delegate responsible for creating FakeObject instances. 2096 | 2097 | 2098 | 2099 | 2100 | 2101 | Represents a completed call to a fake object. 2102 | 2103 | 2104 | 2105 | 2106 | The value set to be returned from the call. 2107 | 2108 | 2109 | 2110 | 2111 | An adapter that adapts an to a . 2112 | 2113 | 2114 | 2115 | 2116 | Initializes a new instance of the class. 2117 | 2118 | The invocation. 2119 | 2120 | 2121 | 2122 | Freezes the call so that it can no longer be modified. 2123 | 2124 | A completed fake object call. 2125 | 2126 | 2127 | 2128 | Calls the base method, should not be used with interface types. 2129 | 2130 | 2131 | 2132 | 2133 | Sets the specified value to the argument at the specified index. 2134 | 2135 | The index of the argument to set the value to. 2136 | The value to set to the argument. 2137 | 2138 | 2139 | 2140 | Sets the return value of the call. 2141 | 2142 | The return value. 2143 | 2144 | 2145 | 2146 | Returns a description of the call. 2147 | 2148 | 2149 | A that represents this instance. 2150 | 2151 | 2152 | 2153 | 2154 | The method that's called. 2155 | 2156 | 2157 | 2158 | 2159 | The arguments used in the call. 2160 | 2161 | 2162 | 2163 | 2164 | The value set to be returned from the call. 2165 | 2166 | 2167 | 2168 | 2169 | The faked object the call is performed on. 2170 | 2171 | 2172 | 2173 | 2174 | 2175 | A call rule that applies to any call and just delegates the 2176 | call to the wrapped object. 2177 | 2178 | 2179 | 2180 | 2181 | Creates a new instance. 2182 | 2183 | The object to wrap. 2184 | 2185 | 2186 | 2187 | Gets wether this interceptor is applicable to the specified 2188 | call, if true is returned the Apply-method of the interceptor will 2189 | be called. 2190 | 2191 | The call to check for applicability. 2192 | True if the interceptor is applicable. 2193 | 2194 | 2195 | 2196 | Applies an action to the call, might set a return value or throw 2197 | an exception. 2198 | 2199 | The call to apply the interceptor to. 2200 | 2201 | 2202 | 2203 | Gets the number of times this call rule is valid, if it's set 2204 | to null its infinitely valid. 2205 | 2206 | 2207 | 2208 | 2209 | 2210 | An exception thrown when an expection is not met (when asserting on fake object calls). 2211 | 2212 | 2213 | 2214 | 2215 | Initializes a new instance of the class. 2216 | 2217 | 2218 | 2219 | 2220 | Initializes a new instance of the class. 2221 | 2222 | The message. 2223 | 2224 | 2225 | 2226 | Initializes a new instance of the class. 2227 | 2228 | The message. 2229 | The inner exception. 2230 | 2231 | 2232 | 2233 | Initializes a new instance of the class. 2234 | 2235 | The that holds the serialized object data about the exception being thrown. 2236 | The that contains contextual information about the source or destination. 2237 | 2238 | The parameter is null. 2239 | 2240 | 2241 | The class name is null or is zero (0). 2242 | 2243 | 2244 | 2245 | 2246 | An implementation of the interface that uses 2247 | expressions for evaluating if the rule is applicable to a specific call. 2248 | 2249 | 2250 | 2251 | 2252 | Initializes a new instance of the class. 2253 | 2254 | The expression matcher to use. 2255 | 2256 | 2257 | 2258 | Returns a that represents this instance. 2259 | 2260 | 2261 | A that represents this instance. 2262 | 2263 | 2264 | 2265 | 2266 | Gets the expression matcher used by this rule. 2267 | 2268 | 2269 | 2270 | 2271 | Handles the instantiation of ExpressionCallRule instance. 2272 | 2273 | An expression specifying the call. 2274 | A rule instance. 2275 | 2276 | 2277 | 2278 | Represents a delegate that creates a configuration object from 2279 | a fake object and the rule to build. 2280 | 2281 | The fake object the rule is for. 2282 | The rule that's being built. 2283 | A configuration object. 2284 | 2285 | 2286 | 2287 | Provides extension methods for configuring and asserting on faked objects 2288 | without going through the static methods of the Fake-class. 2289 | 2290 | 2291 | 2292 | 2293 | Configures the behavior of the fake object when a call that matches the specified 2294 | call happens. 2295 | 2296 | The type of the return value of the member. 2297 | An expression that specifies the calls to configure. 2298 | The faked object to configure. 2299 | The type of fake object to configure. 2300 | A configuration object. 2301 | 2302 | 2303 | 2304 | Configures the behavior of the fake object when a call that matches the specified 2305 | call happens. 2306 | 2307 | The faked object to configure. 2308 | The type of fake object to configure. 2309 | An expression that specifies the calls to configure. 2310 | A configuration object. 2311 | 2312 | 2313 | 2314 | Configures the behavior of the fake object when a call is made to any method on the 2315 | object. 2316 | 2317 | The type of the fake. 2318 | The faked object. 2319 | A configuration object. 2320 | 2321 | 2322 | 2323 | Provides an extension method for configuring fake objects. 2324 | 2325 | 2326 | 2327 | 2328 | Gets an object that provides a fluent interface syntax for configuring 2329 | the fake object. 2330 | 2331 | The type of the fake object. 2332 | The fake object to configure. 2333 | A configuration object. 2334 | The fakedObject was null. 2335 | The object passed in is not a faked object. 2336 | 2337 | 2338 | 2339 | Provides extension methods for fake objects. 2340 | 2341 | 2342 | 2343 | 2344 | Specifies NumberOfTimes(1) to the IRepeatConfiguration{TFake}. 2345 | 2346 | The configuration to set repeat 1 to. 2347 | 2348 | 2349 | 2350 | Specifies NumberOfTimes(2) to the IRepeatConfiguration{TFake}. 2351 | 2352 | The configuration to set repeat 2 to. 2353 | 2354 | 2355 | 2356 | Specifies that the configured call/calls should return null when called. 2357 | 2358 | The type of the faked member. 2359 | The configuration to apply to. 2360 | A configuration object. 2361 | 2362 | 2363 | 2364 | Specifies that a call to the configured call should be applied no matter what arguments 2365 | are used in the call to the faked object. 2366 | 2367 | The configuration. 2368 | A configuration object 2369 | 2370 | 2371 | 2372 | Filters to contain only the calls that matches the call specification. 2373 | 2374 | The type of fake the call is made on. 2375 | The calls to filter. 2376 | The call to match on. 2377 | A collection of the calls that matches the call specification. 2378 | 2379 | 2380 | 2381 | Asserts that the specified call must have happened once or more. 2382 | 2383 | The configuration to assert on. 2384 | 2385 | 2386 | 2387 | Asserts that the specified has not happened. 2388 | 2389 | The configuration to assert on. 2390 | 2391 | 2392 | 2393 | Configures the call to return the next value from the specified sequence each time it's called. Null will 2394 | be returned when all the values in the sequence has been returned. 2395 | 2396 | The type of return value. 2397 | The call configuration to extend. 2398 | The values to return in sequence. 2399 | A configuration object. 2400 | 2401 | 2402 | 2403 | A collection of method arguments. 2404 | 2405 | 2406 | 2407 | 2408 | The arguments this collection contains. 2409 | 2410 | 2411 | 2412 | 2413 | Initializes a new instance of the class. 2414 | 2415 | The arguments. 2416 | The argument names. 2417 | 2418 | 2419 | 2420 | Initializes a new instance of the class. 2421 | 2422 | The arguments. 2423 | The method. 2424 | 2425 | 2426 | 2427 | Gets the argument at the specified index. 2428 | 2429 | The type of the argument to get. 2430 | The index of the argument. 2431 | The argument at the specified index. 2432 | 2433 | 2434 | 2435 | Gets the argument with the specified name. 2436 | 2437 | The type of the argument to get. 2438 | The name of the argument. 2439 | The argument with the specified name. 2440 | 2441 | 2442 | 2443 | Converts the ArgumentCollection to an enumerable that enumerates the argument values. 2444 | 2445 | An IEnumerable(object). 2446 | 2447 | 2448 | 2449 | Gets an empty ArgumentList. 2450 | 2451 | 2452 | 2453 | 2454 | Gets the number of arguments in the list. 2455 | 2456 | 2457 | 2458 | 2459 | Gets the names of the arguments in the list. 2460 | 2461 | 2462 | 2463 | 2464 | Gets the argument at the specified index. 2465 | 2466 | The index of the argument to get. 2467 | The argument at the specified index. 2468 | 2469 | 2470 | 2471 | Handles operations on expressions. 2472 | 2473 | 2474 | 2475 | 2476 | Gets the value produced by the specified expression when compiled and invoked. 2477 | 2478 | The expression to get the value from. 2479 | The value produced by the expression. 2480 | 2481 | 2482 | 2483 | Represents a scope for fake objects, calls configured within a scope 2484 | are only valid within that scope. Only calls made wihtin a scope 2485 | are accessible from within a scope so for example asserts will only 2486 | assert on those calls done within the scope. 2487 | 2488 | 2489 | 2490 | 2491 | Creates a new scope and sets it as the current scope. 2492 | 2493 | The created scope. 2494 | 2495 | 2496 | 2497 | Creates a new scope and sets it as the current scope, using the specified 2498 | container as the container for the new scope. 2499 | 2500 | The container to usee for the new scope. 2501 | The created scope. 2502 | 2503 | 2504 | 2505 | Closes the scope. 2506 | 2507 | 2508 | 2509 | 2510 | Adds an intercepted call to the current scope. 2511 | 2512 | The fake object. 2513 | The call that is intercepted. 2514 | 2515 | 2516 | 2517 | Adds a fake object call to the current scope. 2518 | 2519 | The fake object. 2520 | The rule to add. 2521 | 2522 | 2523 | 2524 | Provides methods for guarding method arguments. 2525 | 2526 | 2527 | 2528 | 2529 | Throws an exception if the specified argument is null. 2530 | 2531 | The argument. 2532 | Name of the argument. 2533 | The specified argument was null. 2534 | 2535 | 2536 | 2537 | Throws an exception if the specified argument is not in the given range. 2538 | 2539 | 2540 | The argument. 2541 | The lower bound. 2542 | The upper bound. 2543 | Name of the argument. 2544 | The specified argument was not in the given range. 2545 | 2546 | 2547 | 2548 | Throws an ArgumentNullException if the specified string is null or empty. 2549 | 2550 | The value to guard. 2551 | Name of the argument. 2552 | 2553 | 2554 | 2555 | Interface implemented by generated faked objects in order 2556 | to access the fake object behind it. 2557 | 2558 | 2559 | 2560 | 2561 | Gets the fake object behind a faked object. 2562 | 2563 | A fake object. 2564 | 2565 | 2566 | 2567 | Used by the event raising rule of fake objects to get the event arguments used in 2568 | a call to Raise.With. 2569 | 2570 | 2571 | 2572 | 2573 | The sender of the event. 2574 | 2575 | 2576 | 2577 | 2578 | The event arguments of the event. 2579 | 2580 | 2581 | 2582 | 2583 | Provides static methods for accessing fake objects. 2584 | 2585 | 2586 | 2587 | 2588 | Gets the fake object that manages the faked object. 2589 | 2590 | The faked object to get the manager object for. 2591 | The fake object manager. 2592 | 2593 | 2594 | 2595 | Creates a new scope and sets it as the current scope. When inside a scope the 2596 | getting the calls made to a fake will return only the calls within that scope and when 2597 | asserting that calls were made, the calls must have been made within that scope. 2598 | 2599 | The created scope. 2600 | 2601 | 2602 | 2603 | Creates a new scope and sets it as the current scope. When inside a scope the 2604 | getting the calls made to a fake will return only the calls within that scope and when 2605 | asserting that calls were made, the calls must have been made within that scope. 2606 | 2607 | The container to use within the specified scope. 2608 | The created scope. 2609 | 2610 | 2611 | 2612 | Gets a value indicating if the two objects are equal. 2613 | 2614 | The first object to compare. 2615 | The second object to compare. 2616 | True if the two objects are equal. 2617 | 2618 | 2619 | 2620 | Gets a value indicating if the two objects are the same reference. 2621 | 2622 | The obj A. 2623 | The obj B. 2624 | True if the objects are the same reference. 2625 | 2626 | 2627 | 2628 | Gets all the calls made to the specified fake object. 2629 | 2630 | The faked object. 2631 | A collection containing the calls to the object. 2632 | The object passed in is not a faked object. 2633 | 2634 | 2635 | 2636 | Represents a fake object that provides an api for configuring a faked object, exposed by the 2637 | FakedObject-property. 2638 | 2639 | The type of the faked object. 2640 | 2641 | 2642 | 2643 | Creates a new fake object. 2644 | 2645 | 2646 | 2647 | 2648 | Creates a new fake object using the specified options. 2649 | 2650 | Options used to create the fake object. 2651 | 2652 | 2653 | 2654 | Configures calls to the specified member. 2655 | 2656 | An expression specifying the call to configure. 2657 | A configuration object. 2658 | 2659 | 2660 | 2661 | Configures calls to the specified member. 2662 | 2663 | The type of value the member returns. 2664 | An expression specifying the call to configure. 2665 | A configuration object. 2666 | 2667 | 2668 | 2669 | Configures any call to the fake object. 2670 | 2671 | A configuration object. 2672 | 2673 | 2674 | 2675 | Represents a fake object that provides an api for configuring a faked object, exposed by the 2676 | FakedObject-property. 2677 | 2678 | The type of the faked object. 2679 | 2680 | 2681 | 2682 | Gets the faked object. 2683 | 2684 | 2685 | 2686 | 2687 | Gets all calls made to the faked object. 2688 | 2689 | 2690 | 2691 | 2692 | Allows the developer to raise an event on a faked object. 2693 | 2694 | 2695 | 2696 | 2697 | Raises an event on a faked object by attatching the event handler produced by the method 2698 | to the event that is to be raised. 2699 | 2700 | The type of the event args. 2701 | The sender of the event. 2702 | The instance containing the event data. 2703 | A Raise(TEventArgs)-object that exposes the eventhandler to attatch. 2704 | 2705 | 2706 | 2707 | Raises an event on a faked object by attatching the event handler produced by the method 2708 | to the event that is to be raised. 2709 | 2710 | The type of the event arguments. 2711 | The instance containing the event data. 2712 | 2713 | A Raise(TEventArgs)-object that exposes the eventhandler to attatch. 2714 | 2715 | 2716 | 2717 | 2718 | Raises an event with empty event arguments on a faked object by attatching the event handler produced by the method 2719 | to the event that is to be raised. 2720 | 2721 | 2722 | A Raise(TEventArgs)-object that exposes the eventhandler to attatch. 2723 | 2724 | 2725 | 2726 | 2727 | A class exposing an event handler to attatch to an event of a faked object 2728 | in order to raise that event. 2729 | 2730 | The type of the event args. 2731 | 2732 | 2733 | 2734 | Register this event handler to an event on a faked object in order to raise that event. 2735 | 2736 | The sender of the event. 2737 | Event args for the event. 2738 | 2739 | 2740 | 2741 | Gets a generic event handler to attatch to the event to raise. 2742 | 2743 | 2744 | 2745 | 2746 | Handles the registration of root dependencies in an IoC-container. 2747 | 2748 | 2749 | 2750 | 2751 | Registers the dependencies. 2752 | 2753 | The container to register the dependencies in. 2754 | 2755 | 2756 | 2757 | Provides extension methods for the common uses. 2758 | 2759 | 2760 | 2761 | 2762 | Replaces the format item in a specified System.String with the text equivalent 2763 | of the value of a corresponding System.Object instance in a specified array using 2764 | invariant culture as . 2765 | 2766 | A composite format string. 2767 | An array containing zero or more objects to format. 2768 | The formatted string. 2769 | 2770 | 2771 | 2772 | Gets an enumerable of tuples where the first value of each tuple is a value 2773 | from the first collection and the second value of each tuple is the value at the same postion 2774 | from the second collection. 2775 | 2776 | The type of values in the first collection. 2777 | The type of values in the second collection. 2778 | The first of the collections to combine. 2779 | The second of the collections to combine. 2780 | An enumerable of tuples. 2781 | 2782 | 2783 | 2784 | Joins the collection to a string. 2785 | 2786 | The type of items in the collection. 2787 | The items to join. 2788 | Separator to insert between each item. 2789 | A function that converts from an item to a string value. 2790 | A string representation of the collection. 2791 | 2792 | 2793 | 2794 | Selects a subset of the sequence so that the values returned from the projection run on 2795 | each item in the sequence are distinct. 2796 | 2797 | The type of items in the collection. 2798 | The result of the projection. 2799 | The sequence to filter. 2800 | A projection from the type of items in the sequence to another type. 2801 | The distinct elements. 2802 | 2803 | 2804 | 2805 | An attribute that can be applied to code that should be fixed becuase theres a 2806 | code smell. 2807 | 2808 | 2809 | 2810 | 2811 | A description of the smell. 2812 | 2813 | 2814 | 2815 | 2816 | Represents a tuple of two values. 2817 | 2818 | The first value. 2819 | The second value. 2820 | 2821 | 2822 | 2823 | Initializes a new instance of the class. 2824 | 2825 | The first. 2826 | The second. 2827 | 2828 | 2829 | 2830 | Gets the first value. 2831 | 2832 | The first. 2833 | 2834 | 2835 | 2836 | Gets the second value. 2837 | 2838 | The second. 2839 | 2840 | 2841 | 2842 | Configurations for visual basic. 2843 | 2844 | 2845 | 2846 | 2847 | Provides configuration from VisualBasic. 2848 | 2849 | 2850 | 2851 | 2852 | A call rule that has been recorded. 2853 | 2854 | 2855 | 2856 | 2857 | A call rule that "sits and waits" for the next call, when 2858 | that call occurs the recorded rule is added for that call. 2859 | 2860 | 2861 | 2862 | 2863 | Lets you specify options for the next call to a fake object. 2864 | 2865 | 2866 | 2867 | 2868 | Specifies options for the next call to the specified fake object. The next call will 2869 | be recorded as a call configuration. 2870 | 2871 | The type of the faked object. 2872 | The faked object to configure. 2873 | A call configuration object. 2874 | 2875 | 2876 | 2877 | Manages the applying of recorded calls and recording of new calls when 2878 | using self initialized fakes. 2879 | 2880 | 2881 | 2882 | 2883 | Initializes a new instance of the class. 2884 | 2885 | The storage. 2886 | 2887 | 2888 | 2889 | Applies the call if the call has been recorded. 2890 | 2891 | The call to apply to from recording. 2892 | 2893 | 2894 | 2895 | Records the specified call. 2896 | 2897 | The call to record. 2898 | 2899 | 2900 | 2901 | Saves all recorded calls to the storage. 2902 | 2903 | 2904 | 2905 | 2906 | Gets a value indicating if the recorder is currently recording. 2907 | 2908 | 2909 | 2910 | 2911 | 2912 | Represents a factory responsible for creating recording manager 2913 | instances. 2914 | 2915 | The storage the manager should use. 2916 | A RecordingManager instance. 2917 | 2918 | 2919 | 2920 | --------------------------------------------------------------------------------