Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServerTest.cs @ 5615

Last change on this file since 5615 was 5095, checked in by cneumuel, 14 years ago

#1233

  • fixed config merge process
  • worked on hive server test setup
File size: 1.2 KB
Line 
1using System;
2using System.Text;
3using System.Collections.Generic;
4using System.Linq;
5using Microsoft.VisualStudio.TestTools.UnitTesting;
6using HeuristicLab.Services.Hive.Common.DataTransfer;
7using HeuristicLab.Services.Hive.Common.ServiceContracts;
8using HeuristicLab.Clients.Hive.Slave.Tests;
9using HeuristicLab.Clients.Hive;
10
11namespace HeuristicLab.Services.Hive.Tests {
12  [TestClass]
13  public class ServerTest {
14
15    [ClassInitialize]
16    public static void MyClassInitialize(TestContext testContext) {
17      PluginLoader.pluginAssemblies.Any();
18      ServiceLocator.Instance = new MockServiceLocator(ServiceLocator.Instance);
19    }
20   
21    private IHiveService GetService() {
22      return new HiveService();
23    }
24
25    [TestMethod]
26    public void TestMethod1() {
27      var service = GetService();
28
29      Job job = new Job() {
30        CoresNeeded = 1,
31        MemoryNeeded = 0,
32        Priority = 0
33      };
34
35      JobData jobData = new JobData() {
36        Data = PersistenceUtil.Serialize(new MockJob(500))
37      };
38
39      Guid jobId = service.AddJob(job, jobData);
40
41      Job newJob = service.GetJob(jobId);
42      Assert.AreEqual(job, newJob);
43    }
44  }
45}
Note: See TracBrowser for help on using the repository browser.