Search

Categories

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Send mail to the author(s) E-mail

# Wednesday, April 27, 2016

Inspired by:
http://farm-fresh-code.blogspot.co.uk/2014/02/lightweight-integration-testing-with.html

which was itself inspired by a Jimmy Bogard article
https://lostechies.com/jimmybogard/2012/10/18/isolating-database-data-in-integration-tests/

If you get the MSDTC error
http://toddmeinershagen.blogspot.co.uk/2014/05/data-integration-tests-and-transactions_25.html

Here is the start of an example just using rollback transactions

[TestClass] public class TransactionTests { [TestMethod] public void Insert_User_and_test_transaction_rolls_back() { var user = new User { CreatedDate = DateTime.Now, DisplayName = "Todd Smith4", Email = "todd4@asdf.com", Active = true }; var sql = "INSERT INTO dbo.Users (CreatedDate, DisplayName, Email, Active) VALUES (@CreatedDate, @DisplayName, @Email, @Active)"; db.Execute(sql, user); var retrievedUser = db.Query<User>("select * from users where Email = @email", new { email = user.Email }).FirstOrDefault(); Assert.AreEqual(user.DisplayName, retrievedUser.DisplayName); Assert.AreEqual(user.Active, retrievedUser.Active); Assert.AreEqual(user.CreatedDate.ToString(), retrievedUser.CreatedDate.ToString()); }

asdf

private TransactionScope scope; private DbConnection db; private DapperUserRepositoryTestContext c; private bool rollBackTransaction = true; // before each test [TestInitialize] public void SetUp() { // direct access to the db db = new SqlConnection( ConfigurationManager.ConnectionStrings["DapperMangoTestingConnectionString"].ConnectionString); if (rollBackTransaction) scope = new TransactionScope(); // going through the repo c = new DapperUserRepositoryTestContext(); } // after each test [TestCleanup] public void TearDown() { if (rollBackTransaction) scope.Dispose(); db.Dispose(); }
| | # 
# Wednesday, April 06, 2016
( Git )

I’ve come across a situation where the only way to have git is to install it locally, then push to a safe backed up fileshare.

Setup a bare repo on the fileshare

j:\git\test
git init –bare

Add a remote

c:\dev\test
git init
git add .
git commit –m “initial commit”
git remote add origin file://j:\git\test  -- add a remote called origin…  note file://h:\\git\\booktech notice escapes in gitbash
git push --set-upstream origin master

Clone test

c:\dev\test2
git clone j:\git\test .

| | # 
# Tuesday, March 29, 2016

https://chocolatey.org/

“Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.”

  • Open Cmd prompt as admin
  • Paste in code
  • choco

image

https://chocolatey.org/packages

choco install ccleaner

Very useful for new build!

| | # 
# Thursday, March 24, 2016

for %%a in ("*.mp4") do ffmpeg -i "%%a" "newfiles\%%~na.mp3"

Pause

Converts all mp4's in directory to newfiles\

Open ffmpeg in its own cmd shell

| | # 
# Friday, February 19, 2016
( Azure )

“The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”

http://stackoverflow.com/a/18938991/26086

<httpErrors existingResponse="PassThrough"/>
| | #