コード例 #1
0
        public void SlotCollection_Load_SlotOptionsDoesNotExist()
        {
            // Arrange
            const string json = @"[ { ""id"": ""00"" } ]";
            // Act
            var slotCollection = SlotCollection.Load(json);

            // Assert
            Assert.IsNull(slotCollection[0].SlotOptions);
        }
コード例 #2
0
        public void SlotCollection_Load_MalformedInt32Value()
        {
            // Arrange
            const string json = @"[ { ""id"": ""A"" } ]";
            // Act
            var slotCollection = SlotCollection.Load(json);

            // Assert
            Assert.IsNull(slotCollection[0].ID);
        }
コード例 #3
0
        public void SlotCollection_Load_FromClientVersion_7_1_24()
        {
            var slotCollection = SlotCollection.Load(TestDataReader.ReadStringBuilder("Client_7_1_24_slots.txt"), ObjectLoadOptions.None);

            Assert.AreEqual(1, slotCollection.Count);
            Assert.AreEqual(0, slotCollection[0].ID);
            Assert.AreEqual("RUNNING", slotCollection[0].Status);
            Assert.AreEqual("smp:4", slotCollection[0].Description);
            Assert.AreEqual("true", slotCollection[0].SlotOptions[Options.PauseOnStart]);
        }
コード例 #4
0
        public void SlotCollection_Load_FromClientVersion_7_1_43()
        {
            var slotCollection = SlotCollection.Load(TestDataReader.ReadStringBuilder("Client_7_1_43_slots.txt"));

            Assert.AreEqual(2, slotCollection.Count);
            Assert.AreEqual(0, slotCollection[0].ID);
            Assert.AreEqual("RUNNING", slotCollection[0].Status);
            Assert.AreEqual("smp:4", slotCollection[0].Description);
            Assert.AreEqual("true", slotCollection[0].SlotOptions[Options.PauseOnStart]);
            Assert.AreEqual(1, slotCollection[1].ID);
            Assert.AreEqual("RUNNING", slotCollection[1].Status);
            Assert.AreEqual("gpu:0:\"GT200b [GeForce GTX 285]\"", slotCollection[1].Description);
            Assert.AreEqual("true", slotCollection[1].SlotOptions[Options.PauseOnStart]);
        }
コード例 #5
0
 public void SlotCollection_Load_ReturnsNullWhenJsonTextReaderIsNull()
 {
     Assert.IsNull(SlotCollection.Load((TextReader)null));
 }
コード例 #6
0
 public void SlotCollection_Load_ReturnsNullWhenJsonStringBuilderIsNull()
 {
     Assert.IsNull(SlotCollection.Load((StringBuilder)null));
 }
コード例 #7
0
 public void SlotCollection_Load_ReturnsNullWhenJsonStringIsNull()
 {
     Assert.IsNull(SlotCollection.Load((string)null));
 }