/FakeS3

in-memory and on-disk S3 provider for .NET

Primary LanguageC#Apache License 2.0Apache-2.0

FakeS3.Net

.NET Port of fake-s3.

Nuget

Install

If you just want the IAmazonS3 providers:

dotnet add package FakeS3.AWS

Or, if you dont want IAmazonS3 but still want FakeS3:

dotnet add package FakeS3

Example Usage

On-Disk storage:

using System;
using FakeS3.AWS;

// create a temporary folder to use as the on-disk s3 root
var tempRoot = Path.Join(Path.GetTempPath(), Path.GetRandomFileName());
Directory.CreateDirectory(tempRoot); 

// create IAmazonS3 instance that saves buckets to local folder
var client = FakeS3.CreateFileClient(tempRoot, false);

// use `client` directly or pass it to something like
// `Amazon.S3.Transfer.TransferUtility`

In-Memory storage (Note: in-memory provider is still WIP):

// create IAmazonS3 instance that stores buckets in memory
var client = FakeS3.CreateMemoryClient();

// use `client` directly or pass it to something like
// `Amazon.S3.Transfer.TransferUtility`