Skip to content

Instantly share code, notes, and snippets.

@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.

@orient-man
orient-man / SQLiteForeignKeysTests.cs
Created November 15, 2012 14:59
Explaining SQLite foreign keys support
using System;
using System.Data;
using System.Data.Common;
using System.Data.SQLite;
using NUnit.Framework;
namespace MyApplication.Tests
{
[TestFixture]
public class SQLiteForeignKeysTests
using Castle.DynamicProxy;
namespace MyCompany.Infrastructure.Validation
{
public static class ValidationListenerExtensions
{
public static bool ListenAll(
this IValidationListener listener,
params IValidator[] validators)
{
@orient-man
orient-man / Validation.cs
Created November 15, 2012 16:00
Validation
namespace MyCompany.Infrastructure.Validation
{
// implemented in UI layer
public interface IValidationListener
{
void OnError(string error);
void OnWarning(string warning);
bool IsIgnored(string warning);
}
@orient-man
orient-man / ProxyAndEnumerable.cs
Created November 16, 2012 13:46
How to write interceptor for iterator?
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Castle.DynamicProxy;
using NUnit.Framework;
namespace MyApplication.Tests
{
[TestFixture]
@orient-man
orient-man / CloseConnectionInterceptor.cs
Created November 19, 2012 10:04
Interceptor for managing database connection life cycle
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Castle.DynamicProxy;
namespace MyCompany.Infrastructure
{
class CloseConnectionInterceptor : IInterceptor
{
@orient-man
orient-man / gist:4538958
Last active December 11, 2015 03:38
Disabling blanket.js in IE8 and older
<!--[if gt IE 8]><!-->
<script type="text/javascript" src="blanket.js"></script>
<!--<![endif]-->