using (var stream = Assembly.GetAssembly(typeof(StubPolicy)).GetManifestResourceStream( “Documents.TestHelpers.Files.test.msg”)) { const int bufferLength = 256; var buffer = new Byte[bufferLength]; if (stream != null) { int bytesRead =…
using System; using System.Collections.Generic; namespace Matlock.Core.Specification { public interface ISpecification<T> { bool IsSatisfiedBy(T candidate); ISpecification<T> And(ISpecification<T> other); ISpecification<T> Or(ISpecification<T> other); ISpecification<T> XOr(ISpecification<T> other); ISpecification<T> AndAllOf(IEnumerable<ISpecification<T>>…
const int maxSize = 52428800; var binding = new BasicHttpBinding(); binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName; binding.Security.Message.AlgorithmSuite = SecurityAlgorithmSuite.Default;…
public static class Extensions { public static Hashtable ConvertPropertiesAndValuesToHashtable(this object obj) { var ht = new Hashtable(); // get all public static properties of obj…
In the web.config in between the <configuration></configuration> tags <system.diagnostics> <sources> <source name=”System.ServiceModel” switchValue=”Information, ActivityTracing” propagateActivity=”true”> <listeners> <add name=”traceListener” type=”System.Diagnostics.XmlWriterTraceListener” initializeData= “WCFTrace.svclog” /> </listeners> </source>…
using System; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.Linq; using System.Text; namespace Challenger.Global.Util.Extensions { public static class EnumExtensionMethods { public static T ParseAsEnumByDescriptionAttribute<T>(this string…
<?xml version=”1.0″ encoding=”utf-8″ ?> <configuration> <log4net> <appender name=”WindowsEventAppender” type=”log4net.Appender.EventLogAppender”> <param name=”LogName” value=”Application” /> <applicationName value=”Phoenix” /> <layout type=”log4net.Layout.PatternLayout”> <conversionPattern value=”%date [%thread] %-5level %logger%newline => %message%newline”…
tnamespace Example { using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Rhino.Mocks; public abstract class ContextSpecification<T> { protected Exception executionException; protected T sut { get; set; } [TestInitialize]…
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; namespace TestHelpers { public static class RandomHelper { /* This method can be used to…