Skip to content

Instantly share code, notes, and snippets.

@orient-man
orient-man / DotModuleDiagram.cs
Created March 8, 2013 11:50
Draws diagram of system modules based on assembly references.
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
namespace Company.MvcApp.Utils
{
public class DotModuleDiagram
{
private readonly Regex moduleIncludeRegex = new Regex(@"^Company\.System\..*Core$");
@orient-man
orient-man / MSBuildScript.xml
Created April 26, 2013 10:07
MSBuild script for deploying ASP.NET MVC3 application. Creates ZIP package containing compiled application with MVC3 assemblies inside (deploying app requires only .NET 4.0 & IIS on target computer). Razor views are precompiled and merged into one assembly (MyApp.Web.Content.dll).
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Platform>x86</Platform>
<MSBuildCommunityTasksPath>.\</MSBuildCommunityTasksPath>
<ExtensionTasksPath>.\</ExtensionTasksPath>
<LibsDir>..\lib</LibsDir>
<DeployDir>..\deployed</DeployDir>
<PackageDir>..\package</PackageDir>
<PrecompiledDir>..\precompiled</PrecompiledDir>
var client = new ServiceStack.ServiceClient.Web.JsonServiceClient();
dynamic r = client
.Send<string>("GET","http://127.0.0.1:8080/yourServiceStack/como-esta", new { Name = "Michael Buen" })
.JsDeserialize();
@orient-man
orient-man / SmokeTests.cs
Last active September 10, 2017 20:50
Smoke test for our ASP.NET MVC application using FakeHost (based on MvcIntegrationTestFramework: http://blog.stevensanderson.com/2009/06/11/integration-testing-your-aspnet-mvc-application/)
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using System.Web;
using FakeHost;
using FluentAssertions;
using HtmlAgilityPack;
using NUnit.Framework;
@orient-man
orient-man / Fixtures.cs
Created December 19, 2013 13:41
Simplified implementation of xunit's IUseFixture handling for NUnit
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace Piatka.Infrastructure.Tests.Fixtures
{
public interface IUseFixture<T> where T : IDisposable
{
void SetFixture(T data);
@orient-man
orient-man / Intercept.cs
Created January 13, 2014 13:40
Bug: wrong interceptor is chosen when multiple bindings exist
using NUnit.Framework;
using Ninject;
using Ninject.Extensions.Interception;
using Ninject.Extensions.Interception.Infrastructure.Language;
namespace NInjectInterceptionTest
{
public class Program
{
public interface IFoo
@orient-man
orient-man / InterceptionTests.cs
Created March 18, 2014 17:50
Unit test describing problems with interception of inherited methods...
using Ninject;
using Ninject.Extensions.Interception;
using Ninject.Extensions.Interception.Attributes;
using Ninject.Extensions.Interception.Infrastructure.Language;
using Ninject.Extensions.Interception.Request;
using NUnit.Framework;
namespace InterceptionGotchas
{
[TestFixture]
@orient-man
orient-man / FactoriesTests.cs
Created April 17, 2014 10:46
Example of factory with dependencies chosen by factory method name
using Ninject;
using Ninject.Extensions.Factory;
using NUnit.Framework;
namespace NInjectFactories
{
public interface IFooFactory
{
IFoo GetFoo1();
IFoo GetFoo2();
@orient-man
orient-man / diff.patch
Created February 25, 2015 14:06
DailyWTF
Index: C:/projekty/Pincasso.NET/src/Pincasso.Ckm.Core.Tests/Pincasso.Ckm.Core.Tests.csproj
===================================================================
--- C:/projekty/Pincasso.NET/src/Pincasso.Ckm.Core.Tests/Pincasso.Ckm.Core.Tests.csproj (wersja 39573)
+++ C:/projekty/Pincasso.NET/src/Pincasso.Ckm.Core.Tests/Pincasso.Ckm.Core.Tests.csproj (wersja 39574)
@@ -97,7 +97,6 @@
<Compile Include="Samples\SamplesDataEksportFaktur.cs" />
<Compile Include="SelfTests\BuildersTests.cs" />
<Compile Include="SetUpFixture.cs" />
- <Compile Include="Unit\DostepnoscDrukowaniaCkmServiceTests.cs" />
<Compile Include="Unit\ElementyPaczkiServiceTests.cs" />
  1. Potrzebne zbiory: ceny.btr, uslugi.btr i zmiany.mkd z Centrali

  2. Procedura importu jest zapisana jako test automatyczny w projecie Sprzefak.NET:

  • svn://192.168.20.105:3693/trunk/sprzefak.NET
  • svn://192.168.20.105:3693/trunk/sprzefak.NET/src/Sprzefak.Core.Test/ImporterUslugTests.cs
  1. Odpalenie testu:

a) Zmieniam stałą SkoroszytUslug na ścieżkę arkusza Excel zawierającego nowe usługi/ceny.