Exemplo n.º 1
0
        public async Task AddAsync_CreateNewBucket()
        {
            const string      bucketName       = "First";
            IBucketRepository bucketRepository = new InMemoryBucketRepository();
            Bucket            bucket           = new Bucket(bucketName);

            await bucketRepository.AddAsync(bucket);

            Bucket fetchedBucket = await bucketRepository.GetAsync(bucketName);

            Assert.Same(bucket, fetchedBucket);
        }
Exemplo n.º 2
0
        public async Task add_async_should_create_new_bucket()
        {
            var repository = new InMemoryBucketRepository();
            var name       = "test-bucket";
            var bucket     = new Bucket(Guid.NewGuid(), name);

            await repository.AddAsync(bucket);

            var createdBucket = await repository.GetAsync(name);

            Assert.Same(bucket, createdBucket);
        }
Exemplo n.º 3
0
        public async Task add_async_should_create_new_bucket()
        {
            //Arrange
            var repository = new InMemoryBucketRepository();
            var name       = "test";
            var bucket     = new Bucket(Guid.NewGuid(), name);

            //Act
            await repository.AddAsync(bucket);

            //Assert
            var createdBucket = await repository.GetAsync(name);

            Assert.Same(bucket, createdBucket);

            bucket.ShouldBeEquivalentTo(createdBucket);
        }