コード例 #1
0
ファイル: ServiceUnitTests.cs プロジェクト: orthros/MonCF
        public void TestSaveSimpleData()
        {
            StubDataStore stubDataStore = new StubDataStore();
            SimpleService simpleServiceToTest = new SimpleService(stubDataStore);

            var simpleData = TestUtils.GetRandomSimpleData();

            simpleServiceToTest.SaveSimpleData(simpleData);
        }
コード例 #2
0
ファイル: ServiceUnitTests.cs プロジェクト: orthros/MonCF
        public void TestNullSaveSimpleData()
        {
            StubDataStore stubDataStore = new StubDataStore();
            SimpleService simpleServiceToTest = new SimpleService(stubDataStore);

            Assert.Throws(typeof(ArgumentNullException), () =>
            {
                simpleServiceToTest.SaveSimpleData(null);
            });
        }
コード例 #3
0
        public void ServiceSaveSimple()
        {
            StubDataStore stubDataStore = new StubDataStore();

            SimpleService simpleServiceToTest = new SimpleService(stubDataStore);

            Guid theID = Guid.NewGuid();

            var simpleData = new SimpleData(theID, "test1", 1000);

            simpleServiceToTest.SaveSimpleData(simpleData);

            var dataBack = simpleServiceToTest.GetSimpleData(theID);

            Assert.Equal(simpleData, dataBack);
        }