public void TestCreateDiskBad() { using (var persistence = GetPersistence()) { var s = new DiskServiceImpl(persistence); var disk = s.CreateDisk(new UserDto { Login = "******", HashedPassword = "******" }, null); Assert.IsNull(disk); } }
public void TestAuthenticationOnCreateDisk() { using (var s = new DiskServiceImpl(GetPersistence())) { s.Login("nananana", "blub"); var disk = s.CreateDisk(new UserDto { Login = "******", HashedPassword = "******" }, new DiskOptionsDto { BlockSize = 1000, MasterBlockSize = 1000, SerializedFileSystemOptions = new byte[10] }); } }
public void TestCreateDiskSuccess() { using (var persistence = GetPersistenceWithUser()) { var user = persistence.CreateUser(_userDto.Login, _userDto.HashedPassword); var s = new DiskServiceImpl(persistence); var disk = s.CreateDisk(user, new DiskOptionsDto()); Assert.AreEqual(user.Id, disk.UserId); Assert.AreEqual(1, persistence.Disks(user).Count); Assert.AreEqual(user.Id, persistence.Disks(user).First().UserId); Assert.AreEqual(user.Id, disk.UserId); Assert.AreEqual(1, disk.UserId); } }